<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP, RankNTypes, MagicHash, BangPatterns, TypeFamilies #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-comment">-- CPP C style pre-precessing, the #if defined lines</span><span>
</span><span id="line-4"></span><span class="hs-comment">-- RankNTypes forall r. statement</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- MagicHash the (# unboxing #), also needs GHC.primitives</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.Binary.Get.Internal</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-8"></span><span>
</span><span id="line-9"></span><span>    </span><span class="annot"><span class="hs-comment">-- * The Get type</span></span><span>
</span><span id="line-10"></span><span>      </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier">Get</span></a></span><span>
</span><span id="line-11"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#runCont"><span class="hs-identifier">runCont</span></a></span><span>
</span><span id="line-12"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Decoder"><span class="hs-identifier">Decoder</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-13"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#runGetIncremental"><span class="hs-identifier">runGetIncremental</span></a></span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#readN"><span class="hs-identifier">readN</span></a></span><span>
</span><span id="line-16"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#readNWith"><span class="hs-identifier">readNWith</span></a></span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Parsing</span></span><span>
</span><span id="line-19"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#bytesRead"><span class="hs-identifier">bytesRead</span></a></span><span>
</span><span id="line-20"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#isolate"><span class="hs-identifier">isolate</span></a></span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span>    </span><span class="annot"><span class="hs-comment">-- * With input chunks</span></span><span>
</span><span id="line-23"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#withInputChunks"><span class="hs-identifier">withInputChunks</span></a></span><span>
</span><span id="line-24"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Consume"><span class="hs-identifier">Consume</span></a></span><span>
</span><span id="line-25"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#failOnEOF"><span class="hs-identifier">failOnEOF</span></a></span><span>
</span><span id="line-26"></span><span>
</span><span id="line-27"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#get"><span class="hs-identifier">get</span></a></span><span>
</span><span id="line-28"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#put"><span class="hs-identifier">put</span></a></span><span>
</span><span id="line-29"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#ensureN"><span class="hs-identifier">ensureN</span></a></span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Utility</span></span><span>
</span><span id="line-32"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#remaining"><span class="hs-identifier">remaining</span></a></span><span>
</span><span id="line-33"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#getBytes"><span class="hs-identifier">getBytes</span></a></span><span>
</span><span id="line-34"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#isEmpty"><span class="hs-identifier">isEmpty</span></a></span><span>
</span><span id="line-35"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#lookAhead"><span class="hs-identifier">lookAhead</span></a></span><span>
</span><span id="line-36"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#lookAheadM"><span class="hs-identifier">lookAheadM</span></a></span><span>
</span><span id="line-37"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#lookAheadE"><span class="hs-identifier">lookAheadE</span></a></span><span>
</span><span id="line-38"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#label"><span class="hs-identifier">label</span></a></span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** ByteStrings</span></span><span>
</span><span id="line-41"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier">getByteString</span></a></span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-44"></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Foreign.html#"><span class="hs-identifier">Foreign</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.html#"><span class="hs-identifier">Data.ByteString</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">B</span></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Unsafe.html#"><span class="hs-identifier">Data.ByteString.Unsafe</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">B</span></span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Applicative.html#"><span class="hs-identifier">Control.Applicative</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span class="hs-cpp">
#if MIN_VERSION_base(4,9,0)
</span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.Fail.html#"><span class="hs-identifier">Control.Monad.Fail</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Fail</span></span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Binary.Internal.html"><span class="hs-identifier">Data.Binary.Internal</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#accursedUnutterablePerformIO"><span class="hs-identifier">accursedUnutterablePerformIO</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-56"></span><span>
</span><span id="line-57"></span><span class="hs-comment">-- Kolmodin 20100427: at zurihac we discussed of having partial take a</span><span>
</span><span id="line-58"></span><span class="hs-comment">-- &quot;Maybe ByteString&quot; and implemented it in this way.</span><span>
</span><span id="line-59"></span><span class="hs-comment">-- The reasoning was that you could accidently provide an empty bytestring,</span><span>
</span><span id="line-60"></span><span class="hs-comment">-- and it should not terminate the decoding (empty would mean eof).</span><span>
</span><span id="line-61"></span><span class="hs-comment">-- However, I'd say that it's also a risk that you get stuck in a loop,</span><span>
</span><span id="line-62"></span><span class="hs-comment">-- where you keep providing an empty string. Anyway, no new input should be</span><span>
</span><span id="line-63"></span><span class="hs-comment">-- rare, as the RTS should only wake you up if you actually have some data</span><span>
</span><span id="line-64"></span><span class="hs-comment">-- to read from your fd.</span><span>
</span><span id="line-65"></span><span>
</span><span id="line-66"></span><span class="hs-comment">-- | A decoder produced by running a 'Get' monad.</span><span>
</span><span id="line-67"></span><span class="hs-keyword">data</span><span> </span><span id="Decoder"><span class="annot"><a href="Data.Binary.Get.Internal.html#Decoder"><span class="hs-identifier hs-var">Decoder</span></a></span></span><span> </span><span id="local-6989586621679055344"><span class="annot"><a href="#local-6989586621679055344"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Fail"><span class="annot"><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span></span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-68"></span><span>              </span><span class="hs-comment">-- ^ The decoder ran into an error. The decoder either used</span><span>
</span><span id="line-69"></span><span>              </span><span class="hs-comment">-- 'fail' or was not provided enough input.</span><span>
</span><span id="line-70"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span id="Partial"><span class="annot"><a href="Data.Binary.Get.Internal.html#Partial"><span class="hs-identifier hs-var">Partial</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Decoder"><span class="hs-identifier hs-type">Decoder</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055344"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-71"></span><span>              </span><span class="hs-comment">-- ^ The decoder has consumed the available input and needs</span><span>
</span><span id="line-72"></span><span>              </span><span class="hs-comment">-- more to continue. Provide 'Just' if more input is available</span><span>
</span><span id="line-73"></span><span>              </span><span class="hs-comment">-- and 'Nothing' otherwise, and you will get a new 'Decoder'.</span><span>
</span><span id="line-74"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span id="Done"><span class="annot"><a href="Data.Binary.Get.Internal.html#Done"><span class="hs-identifier hs-var">Done</span></a></span></span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055344"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-75"></span><span>              </span><span class="hs-comment">-- ^ The decoder has successfully finished. Except for the</span><span>
</span><span id="line-76"></span><span>              </span><span class="hs-comment">-- output value you also get the unused input.</span><span>
</span><span id="line-77"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span id="BytesRead"><span class="annot"><a href="Data.Binary.Get.Internal.html#BytesRead"><span class="hs-identifier hs-var">BytesRead</span></a></span></span><span> </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Decoder"><span class="hs-identifier hs-type">Decoder</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055344"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-78"></span><span>              </span><span class="hs-comment">-- ^ The decoder needs to know the current position in the input.</span><span>
</span><span id="line-79"></span><span>              </span><span class="hs-comment">-- Given the number of bytes remaning in the decoder, the outer</span><span>
</span><span id="line-80"></span><span>              </span><span class="hs-comment">-- decoder runner needs to calculate the position and</span><span>
</span><span id="line-81"></span><span>              </span><span class="hs-comment">-- resume the decoding.</span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="hs-comment">-- unrolled codensity/state monad</span><span>
</span><span id="line-84"></span><span class="hs-keyword">newtype</span><span> </span><span id="Get"><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-var">Get</span></a></span></span><span> </span><span id="local-6989586621679055372"><span class="annot"><a href="#local-6989586621679055372"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="C"><span class="annot"><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="runCont"><span class="annot"><span class="annottext">forall a. Get a -&gt; forall r. ByteString -&gt; Success a r -&gt; Decoder r
</span><a href="Data.Binary.Get.Internal.html#runCont"><span class="hs-identifier hs-var hs-var">runCont</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679055370"><span class="annot"><a href="#local-6989586621679055370"><span class="hs-identifier hs-type">r</span></a></span></span><span class="hs-operator">.</span><span>
</span><span id="line-85"></span><span>                               </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-86"></span><span>                               </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Success"><span class="hs-identifier hs-type">Success</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055372"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055370"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-87"></span><span>                               </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Decoder"><span class="hs-identifier hs-type">Decoder</span></a></span><span>   </span><span class="annot"><a href="#local-6989586621679055370"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span class="hs-keyword">type</span><span> </span><span id="Success"><span class="annot"><a href="Data.Binary.Get.Internal.html#Success"><span class="hs-identifier hs-var">Success</span></a></span></span><span> </span><span id="local-6989586621679055160"><span class="annot"><a href="#local-6989586621679055160"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span id="local-6989586621679055159"><span class="annot"><a href="#local-6989586621679055159"><span class="hs-identifier hs-type">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055160"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Decoder"><span class="hs-identifier hs-type">Decoder</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055159"><span class="hs-identifier hs-type">r</span></a></span><span>
</span><span id="line-90"></span><span>
</span><span id="line-91"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679055154"><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-92"></span><span>  </span><span id="local-6989586621679055150"><span class="annot"><span class="annottext">return :: forall a. a -&gt; Get a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var hs-var hs-var hs-var">return</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Get a
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span>
</span><span id="line-93"></span><span>  </span><span id="local-6989586621679055149"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. Get a -&gt; (a -&gt; Get b) -&gt; Get b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">(&gt;&gt;=)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Get a -&gt; (a -&gt; Get b) -&gt; Get b
forall a b. Get a -&gt; (a -&gt; Get b) -&gt; Get b
</span><a href="Data.Binary.Get.Internal.html#bindG"><span class="hs-identifier hs-var">bindG</span></a></span><span class="hs-cpp">
#if !(MIN_VERSION_base(4,9,0))
</span><span>  </span><span class="hs-identifier">fail</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">failG</span><span> </span><span class="hs-comment">-- base &lt; 4.9</span><span class="hs-cpp">
#elif !(MIN_VERSION_base(4,13,0))
</span><span>  </span><span class="hs-identifier">fail</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">Fail.fail</span><span> </span><span class="hs-comment">-- base &lt; 4.13</span><span class="hs-cpp">
#endif
</span><span class="hs-comment">-- NB: Starting with base-4.13, the `fail` method</span><span>
</span><span id="line-100"></span><span class="hs-comment">--     has been removed from the `Monad`-class</span><span>
</span><span id="line-101"></span><span class="hs-comment">--     according to the MonadFail proposal (MFP) schedule</span><span>
</span><span id="line-102"></span><span class="hs-comment">--     which completes the process that started with base-4.9.</span><span class="hs-cpp">

#if MIN_VERSION_base(4,9,0)
</span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.Fail.html#MonadFail"><span class="hs-identifier hs-type">Fail.MonadFail</span></a></span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-106"></span><span>  </span><span id="local-6989586621679055142"><span class="annot"><span class="annottext">fail :: forall a. String -&gt; Get a
</span><a href="../../base/src/Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var hs-var hs-var hs-var">fail</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Get a
forall a. String -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#failG"><span class="hs-identifier hs-var">failG</span></a></span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-109"></span><span id="local-6989586621679055139"><span id="local-6989586621679055140"><span class="annot"><a href="Data.Binary.Get.Internal.html#bindG"><span class="hs-identifier hs-type">bindG</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055140"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679055140"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055139"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055139"><span class="hs-identifier hs-type">b</span></a></span></span></span><span>
</span><span id="line-110"></span><span id="bindG"><span class="annot"><span class="annottext">bindG :: forall a b. Get a -&gt; (a -&gt; Get b) -&gt; Get b
</span><a href="Data.Binary.Get.Internal.html#bindG"><span class="hs-identifier hs-var hs-var">bindG</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-type">C</span></a></span><span> </span><span id="local-6989586621679055138"><span class="annot"><span class="annottext">forall r. ByteString -&gt; Success a r -&gt; Decoder r
</span><a href="#local-6989586621679055138"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679055137"><span class="annot"><span class="annottext">a -&gt; Get b
</span><a href="#local-6989586621679055137"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success b r -&gt; Decoder r) -&gt; Get b
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success b r -&gt; Decoder r) -&gt; Get b)
-&gt; (forall r. ByteString -&gt; Success b r -&gt; Decoder r) -&gt; Get b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679055136"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055136"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621679055135"><span class="annot"><span class="annottext">Success b r
</span><a href="#local-6989586621679055135"><span class="hs-identifier hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Success a r -&gt; Decoder r
forall r. ByteString -&gt; Success a r -&gt; Decoder r
</span><a href="#local-6989586621679055138"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055136"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679055134"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055134"><span class="hs-identifier hs-var">i'</span></a></span></span><span> </span><span id="local-6989586621679055133"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679055133"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Get b -&gt; forall r. ByteString -&gt; Success b r -&gt; Decoder r
forall a. Get a -&gt; forall r. ByteString -&gt; Success a r -&gt; Decoder r
</span><a href="Data.Binary.Get.Internal.html#runCont"><span class="hs-identifier hs-var hs-var">runCont</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Get b
</span><a href="#local-6989586621679055137"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679055133"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055134"><span class="hs-identifier hs-var">i'</span></a></span><span> </span><span class="annot"><span class="annottext">Success b r
</span><a href="#local-6989586621679055135"><span class="hs-identifier hs-var">ks</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-111"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#bindG"><span class="hs-pragma hs-type">bindG</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-112"></span><span>
</span><span id="line-113"></span><span id="local-6989586621679055132"><span class="annot"><a href="Data.Binary.Get.Internal.html#failG"><span class="hs-identifier hs-type">failG</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055132"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-114"></span><span id="failG"><span class="annot"><span class="annottext">failG :: forall a. String -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#failG"><span class="hs-identifier hs-var hs-var">failG</span></a></span></span><span> </span><span id="local-6989586621679055131"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679055131"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a)
-&gt; (forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679055130"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055130"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621679055129"><span class="annot"><span class="annottext">Success a r
</span><a href="#local-6989586621679055129"><span class="hs-identifier hs-var">_ks</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; String -&gt; Decoder r
forall a. ByteString -&gt; String -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055130"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679055131"><span class="hs-identifier hs-var">str</span></a></span><span>
</span><span id="line-115"></span><span>
</span><span id="line-116"></span><span id="local-6989586621679055342"><span id="local-6989586621679055343"><span class="annot"><a href="Data.Binary.Get.Internal.html#apG"><span class="hs-identifier hs-type">apG</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679055343"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055342"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055343"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055342"><span class="hs-identifier hs-type">b</span></a></span></span></span><span>
</span><span id="line-117"></span><span id="apG"><span class="annot"><span class="annottext">apG :: forall a b. Get (a -&gt; b) -&gt; Get a -&gt; Get b
</span><a href="Data.Binary.Get.Internal.html#apG"><span class="hs-identifier hs-var hs-var">apG</span></a></span></span><span> </span><span id="local-6989586621679055124"><span class="annot"><span class="annottext">Get (a -&gt; b)
</span><a href="#local-6989586621679055124"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span id="local-6989586621679055123"><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679055123"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-118"></span><span>  </span><span id="local-6989586621679055122"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679055122"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get (a -&gt; b)
</span><a href="#local-6989586621679055124"><span class="hs-identifier hs-var">d</span></a></span><span>
</span><span id="line-119"></span><span>  </span><span id="local-6989586621679055121"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679055121"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679055123"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-120"></span><span>  </span><span class="annot"><span class="annottext">b -&gt; Get b
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679055122"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679055121"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-121"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">0</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#apG"><span class="hs-pragma hs-type">apG</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-122"></span><span>
</span><span id="line-123"></span><span id="local-6989586621679055338"><span id="local-6989586621679055339"><span class="annot"><a href="Data.Binary.Get.Internal.html#fmapG"><span class="hs-identifier hs-type">fmapG</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679055339"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055338"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055339"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055338"><span class="hs-identifier hs-type">b</span></a></span></span></span><span>
</span><span id="line-124"></span><span id="fmapG"><span class="annot"><span class="annottext">fmapG :: forall a b. (a -&gt; b) -&gt; Get a -&gt; Get b
</span><a href="Data.Binary.Get.Internal.html#fmapG"><span class="hs-identifier hs-var hs-var">fmapG</span></a></span></span><span> </span><span id="local-6989586621679055119"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679055119"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679055118"><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679055118"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success b r -&gt; Decoder r) -&gt; Get b
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success b r -&gt; Decoder r) -&gt; Get b)
-&gt; (forall r. ByteString -&gt; Success b r -&gt; Decoder r) -&gt; Get b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679055117"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055117"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621679055116"><span class="annot"><span class="annottext">Success b r
</span><a href="#local-6989586621679055116"><span class="hs-identifier hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Get a -&gt; forall r. ByteString -&gt; Success a r -&gt; Decoder r
forall a. Get a -&gt; forall r. ByteString -&gt; Success a r -&gt; Decoder r
</span><a href="Data.Binary.Get.Internal.html#runCont"><span class="hs-identifier hs-var hs-var">runCont</span></a></span><span> </span><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679055118"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055117"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679055115"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055115"><span class="hs-identifier hs-var">i'</span></a></span></span><span> </span><span id="local-6989586621679055114"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679055114"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Success b r
</span><a href="#local-6989586621679055116"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055115"><span class="hs-identifier hs-var">i'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679055119"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679055114"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-125"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#fmapG"><span class="hs-pragma hs-type">fmapG</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-126"></span><span>
</span><span id="line-127"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679055104"><span id="local-6989586621679055106"><span id="local-6989586621679055108"><span class="annot"><a href="../../base/src/GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-128"></span><span>  </span><span id="local-6989586621679055102"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; Get a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679055101"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679055101"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a)
-&gt; (forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679055100"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055100"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679055099"><span class="annot"><span class="annottext">Success a r
</span><a href="#local-6989586621679055099"><span class="hs-identifier hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Success a r
</span><a href="#local-6989586621679055099"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055100"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679055101"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-129"></span><span>  </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">0</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#pure"><span class="hs-pragma hs-type">pure</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-130"></span><span>  </span><span id="local-6989586621679055098"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. Get (a -&gt; b) -&gt; Get a -&gt; Get b
</span><a href="../../base/src/GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;*&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Get (a -&gt; b) -&gt; Get a -&gt; Get b
forall a b. Get (a -&gt; b) -&gt; Get a -&gt; Get b
</span><a href="Data.Binary.Get.Internal.html#apG"><span class="hs-identifier hs-var">apG</span></a></span><span>
</span><span id="line-131"></span><span>  </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&lt;*&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-132"></span><span>
</span><span id="line-133"></span><span class="hs-comment">-- | @since 0.7.1.0</span><span>
</span><span id="line-134"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#MonadPlus"><span class="hs-identifier hs-type">MonadPlus</span></a></span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-135"></span><span>  </span><span id="local-6989586621679055087"><span class="annot"><span class="annottext">mzero :: forall a. Get a
</span><a href="../../base/src/GHC.Base.html#mzero"><span class="hs-identifier hs-var hs-var hs-var hs-var">mzero</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Get a
forall (f :: * -&gt; *) a. Alternative f =&gt; f a
</span><a href="../../base/src/GHC.Base.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-136"></span><span>  </span><span id="local-6989586621679055083"><span class="annot"><span class="annottext">mplus :: forall a. Get a -&gt; Get a -&gt; Get a
</span><a href="../../base/src/GHC.Base.html#mplus"><span class="hs-identifier hs-var hs-var hs-var hs-var">mplus</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Get a -&gt; Get a -&gt; Get a
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">(&lt;|&gt;)</span></a></span><span>
</span><span id="line-137"></span><span>
</span><span id="line-138"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679055078"><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-139"></span><span>  </span><span id="local-6989586621679055076"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; Get a -&gt; Get b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; Get a -&gt; Get b
forall a b. (a -&gt; b) -&gt; Get a -&gt; Get b
</span><a href="Data.Binary.Get.Internal.html#fmapG"><span class="hs-identifier hs-var">fmapG</span></a></span><span>
</span><span id="line-140"></span><span>
</span><span id="line-141"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679055073"><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Decoder"><span class="hs-identifier hs-type">Decoder</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-142"></span><span>  </span><span id="local-6989586621679055070"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; Decoder a -&gt; Decoder b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679055069"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679055069"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Get.Internal.html#Done"><span class="hs-identifier hs-type">Done</span></a></span><span> </span><span id="local-6989586621679055068"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055068"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679055067"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679055067"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; b -&gt; Decoder b
forall a. ByteString -&gt; a -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Done"><span class="hs-identifier hs-var">Done</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055068"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679055069"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679055067"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-143"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span id="local-6989586621679055066"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679055066"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Get.Internal.html#Partial"><span class="hs-identifier hs-type">Partial</span></a></span><span> </span><span id="local-6989586621679055065"><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder a
</span><a href="#local-6989586621679055065"><span class="hs-identifier hs-var">k</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Maybe ByteString -&gt; Decoder b) -&gt; Decoder b
forall a. (Maybe ByteString -&gt; Decoder a) -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Partial"><span class="hs-identifier hs-var">Partial</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; Decoder a -&gt; Decoder b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679055066"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Decoder a -&gt; Decoder b)
-&gt; (Maybe ByteString -&gt; Decoder a) -&gt; Maybe ByteString -&gt; Decoder b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder a
</span><a href="#local-6989586621679055065"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-144"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-type">Fail</span></a></span><span> </span><span id="local-6989586621679055063"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055063"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679055062"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679055062"><span class="hs-identifier hs-var">msg</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; String -&gt; Decoder b
forall a. ByteString -&gt; String -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055063"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679055062"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-145"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span id="local-6989586621679055061"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679055061"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Get.Internal.html#BytesRead"><span class="hs-identifier hs-type">BytesRead</span></a></span><span> </span><span id="local-6989586621679055060"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679055060"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621679055059"><span class="annot"><span class="annottext">Int64 -&gt; Decoder a
</span><a href="#local-6989586621679055059"><span class="hs-identifier hs-var">k</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; (Int64 -&gt; Decoder b) -&gt; Decoder b
forall a. Int64 -&gt; (Int64 -&gt; Decoder a) -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#BytesRead"><span class="hs-identifier hs-var">BytesRead</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679055060"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; Decoder a -&gt; Decoder b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679055061"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Decoder a -&gt; Decoder b)
-&gt; (Int64 -&gt; Decoder a) -&gt; Int64 -&gt; Decoder b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Decoder a
</span><a href="#local-6989586621679055059"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-146"></span><span>
</span><span id="line-147"></span><span id="local-6989586621679055297"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679055054"><span id="local-6989586621679055057"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055297"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Get.Internal.html#Decoder"><span class="hs-identifier hs-type">Decoder</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055297"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-148"></span><span>  </span><span id="local-6989586621679055051"><span class="annot"><span class="annottext">show :: Decoder a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var hs-var hs-var hs-var">show</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-type">Fail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679055049"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679055049"><span class="hs-identifier hs-var">msg</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Fail: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679055049"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-149"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Get.Internal.html#Partial"><span class="hs-identifier hs-type">Partial</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder a
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Partial _&quot;</span></span><span>
</span><span id="line-150"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Get.Internal.html#Done"><span class="hs-identifier hs-type">Done</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679055048"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679055048"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Done: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679055048"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-151"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Get.Internal.html#BytesRead"><span class="hs-identifier hs-type">BytesRead</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Decoder a
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;BytesRead&quot;</span></span></span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span class="hs-comment">-- | Run a 'Get' monad. See 'Decoder' for what to do next, like providing</span><span>
</span><span id="line-154"></span><span class="hs-comment">-- input, handling decoding errors and to get the output value.</span><span>
</span><span id="line-155"></span><span id="local-6989586621679055295"><span class="annot"><a href="Data.Binary.Get.Internal.html#runGetIncremental"><span class="hs-identifier hs-type">runGetIncremental</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055295"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Decoder"><span class="hs-identifier hs-type">Decoder</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055295"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-156"></span><span id="runGetIncremental"><span class="annot"><span class="annottext">runGetIncremental :: forall a. Get a -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#runGetIncremental"><span class="hs-identifier hs-var hs-var">runGetIncremental</span></a></span></span><span> </span><span id="local-6989586621679055047"><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679055047"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Decoder a -&gt; Decoder a
forall a. Decoder a -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#noMeansNo"><span class="hs-identifier hs-var">noMeansNo</span></a></span><span> </span><span class="annot"><span class="annottext">(Decoder a -&gt; Decoder a) -&gt; Decoder a -&gt; Decoder a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-157"></span><span>  </span><span class="annot"><span class="annottext">Get a -&gt; forall r. ByteString -&gt; Success a r -&gt; Decoder r
forall a. Get a -&gt; forall r. ByteString -&gt; Success a r -&gt; Decoder r
</span><a href="Data.Binary.Get.Internal.html#runCont"><span class="hs-identifier hs-var hs-var">runCont</span></a></span><span> </span><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679055047"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#empty"><span class="hs-identifier hs-var">B.empty</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679055044"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055044"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621679055043"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679055043"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Success a a
forall a. ByteString -&gt; a -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Done"><span class="hs-identifier hs-var">Done</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055044"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679055043"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span class="hs-comment">-- | Make sure we don't have to pass Nothing to a Partial twice.</span><span>
</span><span id="line-160"></span><span class="hs-comment">-- This way we don't need to pass around an EOF value in the Get monad, it</span><span>
</span><span id="line-161"></span><span class="hs-comment">-- can safely ask several times if it needs to.</span><span>
</span><span id="line-162"></span><span id="local-6989586621679055293"><span class="annot"><a href="Data.Binary.Get.Internal.html#noMeansNo"><span class="hs-identifier hs-type">noMeansNo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Decoder"><span class="hs-identifier hs-type">Decoder</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055293"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Decoder"><span class="hs-identifier hs-type">Decoder</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055293"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-163"></span><span id="noMeansNo"><span class="annot"><span class="annottext">noMeansNo :: forall a. Decoder a -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#noMeansNo"><span class="hs-identifier hs-var hs-var">noMeansNo</span></a></span></span><span> </span><span id="local-6989586621679055042"><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679055042"><span class="hs-identifier hs-var">r0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Decoder a -&gt; Decoder a
forall a. Decoder a -&gt; Decoder a
</span><a href="#local-6989586621679055041"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679055042"><span class="hs-identifier hs-var">r0</span></a></span><span>
</span><span id="line-164"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-165"></span><span>  </span><span id="local-6989586621679055041"><span class="annot"><span class="annottext">go :: Decoder a -&gt; Decoder a
</span><a href="#local-6989586621679055041"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679055040"><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679055040"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-166"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679055040"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-167"></span><span>      </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Partial"><span class="hs-identifier hs-type">Partial</span></a></span><span> </span><span id="local-6989586621679055039"><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder a
</span><a href="#local-6989586621679055039"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Maybe ByteString -&gt; Decoder a) -&gt; Decoder a
forall a. (Maybe ByteString -&gt; Decoder a) -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Partial"><span class="hs-identifier hs-var">Partial</span></a></span><span> </span><span class="annot"><span class="annottext">((Maybe ByteString -&gt; Decoder a) -&gt; Decoder a)
-&gt; (Maybe ByteString -&gt; Decoder a) -&gt; Decoder a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679055038"><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="#local-6989586621679055038"><span class="hs-identifier hs-var">ms</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-168"></span><span>                    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="#local-6989586621679055038"><span class="hs-identifier hs-var">ms</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-169"></span><span>                      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Decoder a -&gt; Decoder a
</span><a href="#local-6989586621679055041"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder a
</span><a href="#local-6989586621679055039"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="#local-6989586621679055038"><span class="hs-identifier hs-var">ms</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-170"></span><span>                      </span><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Decoder a -&gt; Decoder a
forall a. Decoder a -&gt; Decoder a
</span><a href="#local-6989586621679055037"><span class="hs-identifier hs-var">neverAgain</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder a
</span><a href="#local-6989586621679055039"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="#local-6989586621679055038"><span class="hs-identifier hs-var">ms</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-171"></span><span>      </span><span class="annot"><a href="Data.Binary.Get.Internal.html#BytesRead"><span class="hs-identifier hs-type">BytesRead</span></a></span><span> </span><span id="local-6989586621679055036"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679055036"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679055035"><span class="annot"><span class="annottext">Int64 -&gt; Decoder a
</span><a href="#local-6989586621679055035"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; (Int64 -&gt; Decoder a) -&gt; Decoder a
forall a. Int64 -&gt; (Int64 -&gt; Decoder a) -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#BytesRead"><span class="hs-identifier hs-var">BytesRead</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679055036"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Decoder a -&gt; Decoder a
</span><a href="#local-6989586621679055041"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">(Decoder a -&gt; Decoder a)
-&gt; (Int64 -&gt; Decoder a) -&gt; Int64 -&gt; Decoder a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Decoder a
</span><a href="#local-6989586621679055035"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-172"></span><span>      </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Done"><span class="hs-identifier hs-type">Done</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679055040"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-173"></span><span>      </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-type">Fail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679055040"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-174"></span><span>  </span><span id="local-6989586621679055037"><span class="annot"><span class="annottext">neverAgain :: Decoder a -&gt; Decoder a
</span><a href="#local-6989586621679055037"><span class="hs-identifier hs-var hs-var">neverAgain</span></a></span></span><span> </span><span id="local-6989586621679055034"><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679055034"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-175"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679055034"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-176"></span><span>      </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Partial"><span class="hs-identifier hs-type">Partial</span></a></span><span> </span><span id="local-6989586621679055033"><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder a
</span><a href="#local-6989586621679055033"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Decoder a -&gt; Decoder a
</span><a href="#local-6989586621679055037"><span class="hs-identifier hs-var">neverAgain</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder a
</span><a href="#local-6989586621679055033"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ByteString
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-177"></span><span>      </span><span class="annot"><a href="Data.Binary.Get.Internal.html#BytesRead"><span class="hs-identifier hs-type">BytesRead</span></a></span><span> </span><span id="local-6989586621679055032"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679055032"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679055031"><span class="annot"><span class="annottext">Int64 -&gt; Decoder a
</span><a href="#local-6989586621679055031"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; (Int64 -&gt; Decoder a) -&gt; Decoder a
forall a. Int64 -&gt; (Int64 -&gt; Decoder a) -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#BytesRead"><span class="hs-identifier hs-var">BytesRead</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679055032"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Decoder a -&gt; Decoder a
</span><a href="#local-6989586621679055037"><span class="hs-identifier hs-var">neverAgain</span></a></span><span> </span><span class="annot"><span class="annottext">(Decoder a -&gt; Decoder a)
-&gt; (Int64 -&gt; Decoder a) -&gt; Int64 -&gt; Decoder a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Decoder a
</span><a href="#local-6989586621679055031"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-178"></span><span>      </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-type">Fail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679055034"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-179"></span><span>      </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Done"><span class="hs-identifier hs-type">Done</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679055034"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-180"></span><span>
</span><span id="line-181"></span><span id="local-6989586621679055288"><span class="annot"><a href="Data.Binary.Get.Internal.html#prompt"><span class="hs-identifier hs-type">prompt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Decoder"><span class="hs-identifier hs-type">Decoder</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055288"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Decoder"><span class="hs-identifier hs-type">Decoder</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055288"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Decoder"><span class="hs-identifier hs-type">Decoder</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055288"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-182"></span><span id="prompt"><span class="annot"><span class="annottext">prompt :: forall a.
ByteString -&gt; Decoder a -&gt; (ByteString -&gt; Decoder a) -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#prompt"><span class="hs-identifier hs-var hs-var">prompt</span></a></span></span><span> </span><span id="local-6989586621679055029"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055029"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679055028"><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679055028"><span class="hs-identifier hs-var">kf</span></a></span></span><span> </span><span id="local-6989586621679055027"><span class="annot"><span class="annottext">ByteString -&gt; Decoder a
</span><a href="#local-6989586621679055027"><span class="hs-identifier hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Decoder a -&gt; (ByteString -&gt; Decoder a) -&gt; Decoder a
forall a. Decoder a -&gt; (ByteString -&gt; Decoder a) -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#prompt%27"><span class="hs-identifier hs-var">prompt'</span></a></span><span> </span><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679055028"><span class="hs-identifier hs-var">kf</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679055025"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055025"><span class="hs-identifier hs-var">inp'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Decoder a
</span><a href="#local-6989586621679055027"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055029"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#append"><span class="hs-operator hs-var">`B.append`</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055025"><span class="hs-identifier hs-var">inp'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-183"></span><span>
</span><span id="line-184"></span><span id="local-6989586621679055286"><span class="annot"><a href="Data.Binary.Get.Internal.html#prompt%27"><span class="hs-identifier hs-type">prompt'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Decoder"><span class="hs-identifier hs-type">Decoder</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055286"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Decoder"><span class="hs-identifier hs-type">Decoder</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055286"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Decoder"><span class="hs-identifier hs-type">Decoder</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055286"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-185"></span><span id="prompt%27"><span class="annot"><span class="annottext">prompt' :: forall a. Decoder a -&gt; (ByteString -&gt; Decoder a) -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#prompt%27"><span class="hs-identifier hs-var hs-var">prompt'</span></a></span></span><span> </span><span id="local-6989586621679055023"><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679055023"><span class="hs-identifier hs-var">kf</span></a></span></span><span> </span><span id="local-6989586621679055022"><span class="annot"><span class="annottext">ByteString -&gt; Decoder a
</span><a href="#local-6989586621679055022"><span class="hs-identifier hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-186"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679055021"><span class="annot"><span class="annottext">loop :: Decoder a
</span><a href="#local-6989586621679055021"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-187"></span><span>        </span><span class="annot"><span class="annottext">(Maybe ByteString -&gt; Decoder a) -&gt; Decoder a
forall a. (Maybe ByteString -&gt; Decoder a) -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Partial"><span class="hs-identifier hs-var">Partial</span></a></span><span> </span><span class="annot"><span class="annottext">((Maybe ByteString -&gt; Decoder a) -&gt; Decoder a)
-&gt; (Maybe ByteString -&gt; Decoder a) -&gt; Decoder a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679055020"><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="#local-6989586621679055020"><span class="hs-identifier hs-var">sm</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-188"></span><span>          </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="#local-6989586621679055020"><span class="hs-identifier hs-var">sm</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-189"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679055019"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055019"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Bool
</span><a href="../../bytestring/src/Data.ByteString.html#null"><span class="hs-identifier hs-var">B.null</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055019"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679055021"><span class="hs-identifier hs-var">loop</span></a></span><span>
</span><span id="line-190"></span><span>                   </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Decoder a
</span><a href="#local-6989586621679055022"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055019"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-191"></span><span>            </span><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679055023"><span class="hs-identifier hs-var">kf</span></a></span><span>
</span><span id="line-192"></span><span>  </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679055021"><span class="hs-identifier hs-var">loop</span></a></span><span>
</span><span id="line-193"></span><span>
</span><span id="line-194"></span><span class="hs-comment">-- | Get the total number of bytes read to this point.</span><span>
</span><span id="line-195"></span><span class="annot"><a href="Data.Binary.Get.Internal.html#bytesRead"><span class="hs-identifier hs-type">bytesRead</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span>
</span><span id="line-196"></span><span id="bytesRead"><span class="annot"><span class="annottext">bytesRead :: Get Int64
</span><a href="Data.Binary.Get.Internal.html#bytesRead"><span class="hs-identifier hs-var hs-var">bytesRead</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success Int64 r -&gt; Decoder r) -&gt; Get Int64
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success Int64 r -&gt; Decoder r)
 -&gt; Get Int64)
-&gt; (forall r. ByteString -&gt; Success Int64 r -&gt; Decoder r)
-&gt; Get Int64
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679055013"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055013"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679055012"><span class="annot"><span class="annottext">Success Int64 r
</span><a href="#local-6989586621679055012"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; (Int64 -&gt; Decoder r) -&gt; Decoder r
forall a. Int64 -&gt; (Int64 -&gt; Decoder a) -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#BytesRead"><span class="hs-identifier hs-var">BytesRead</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int64
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">(Int -&gt; Int64) -&gt; Int -&gt; Int64
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="../../bytestring/src/Data.ByteString.html#length"><span class="hs-identifier hs-var">B.length</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055013"><span class="hs-identifier hs-var">inp</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Success Int64 r
</span><a href="#local-6989586621679055012"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679055013"><span class="hs-identifier hs-var">inp</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-197"></span><span>
</span><span id="line-198"></span><span class="hs-comment">-- | Isolate a decoder to operate with a fixed number of bytes, and fail if</span><span>
</span><span id="line-199"></span><span class="hs-comment">-- fewer bytes were consumed, or more bytes were attempted to be consumed.</span><span>
</span><span id="line-200"></span><span class="hs-comment">-- If the given decoder fails, 'isolate' will also fail.</span><span>
</span><span id="line-201"></span><span class="hs-comment">-- Offset from 'bytesRead' will be relative to the start of 'isolate', not the</span><span>
</span><span id="line-202"></span><span class="hs-comment">-- absolute of the input.</span><span>
</span><span id="line-203"></span><span class="hs-comment">--</span><span>
</span><span id="line-204"></span><span class="hs-comment">-- @since 0.7.2.0</span><span>
</span><span id="line-205"></span><span id="local-6989586621679055281"><span class="annot"><a href="Data.Binary.Get.Internal.html#isolate"><span class="hs-identifier hs-type">isolate</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>   </span><span class="hs-comment">-- ^ The number of bytes that must be consumed</span><span>
</span><span id="line-206"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055281"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-comment">-- ^ The decoder to isolate</span><span>
</span><span id="line-207"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055281"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-208"></span><span id="isolate"><span class="annot"><span class="annottext">isolate :: forall a. Int -&gt; Get a -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#isolate"><span class="hs-identifier hs-var hs-var">isolate</span></a></span></span><span> </span><span id="local-6989586621679054983"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054983"><span class="hs-identifier hs-var">n0</span></a></span></span><span> </span><span id="local-6989586621679054982"><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679054982"><span class="hs-identifier hs-var">act</span></a></span></span><span>
</span><span id="line-209"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054983"><span class="hs-identifier hs-var">n0</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Get a
forall (m :: * -&gt; *) a. MonadFail m =&gt; String -&gt; m a
</span><a href="../../base/src/Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;isolate: negative size&quot;</span></span><span>
</span><span id="line-210"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Decoder a -&gt; Get a
</span><a href="#local-6989586621679054980"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054983"><span class="hs-identifier hs-var">n0</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Get a -&gt; forall r. ByteString -&gt; Success a r -&gt; Decoder r
forall a. Get a -&gt; forall r. ByteString -&gt; Success a r -&gt; Decoder r
</span><a href="Data.Binary.Get.Internal.html#runCont"><span class="hs-identifier hs-var hs-var">runCont</span></a></span><span> </span><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679054982"><span class="hs-identifier hs-var">act</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#empty"><span class="hs-identifier hs-var">B.empty</span></a></span><span> </span><span class="annot"><span class="annottext">Success a a
forall a. ByteString -&gt; a -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Done"><span class="hs-identifier hs-var">Done</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-211"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-212"></span><span>  </span><span id="local-6989586621679054980"><span class="annot"><span class="annottext">go :: Int -&gt; Decoder a -&gt; Get a
</span><a href="#local-6989586621679054980"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679054979"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054979"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Get.Internal.html#Done"><span class="hs-identifier hs-type">Done</span></a></span><span> </span><span id="local-6989586621679054978"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054978"><span class="hs-identifier hs-var">left</span></a></span></span><span> </span><span id="local-6989586621679054977"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054977"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-213"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054979"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Bool
</span><a href="../../bytestring/src/Data.ByteString.html#null"><span class="hs-identifier hs-var">B.null</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054978"><span class="hs-identifier hs-var">left</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Get a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054977"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-214"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-215"></span><span>        </span><span class="annot"><span class="annottext">ByteString -&gt; Get ()
</span><a href="Data.Binary.Get.Internal.html#pushFront"><span class="hs-identifier hs-var">pushFront</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054978"><span class="hs-identifier hs-var">left</span></a></span><span>
</span><span id="line-216"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679054974"><span class="annot"><span class="annottext">consumed :: Int
</span><a href="#local-6989586621679054974"><span class="hs-identifier hs-var hs-var">consumed</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054983"><span class="hs-identifier hs-var">n0</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054979"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="../../bytestring/src/Data.ByteString.html#length"><span class="hs-identifier hs-var">B.length</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054978"><span class="hs-identifier hs-var">left</span></a></span><span>
</span><span id="line-217"></span><span>        </span><span class="annot"><span class="annottext">String -&gt; Get a
forall (m :: * -&gt; *) a. MonadFail m =&gt; String -&gt; m a
</span><a href="../../base/src/Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; Get a) -&gt; String -&gt; Get a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;isolate: the decoder consumed &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054974"><span class="hs-identifier hs-var">consumed</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; bytes&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-218"></span><span>                 </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; which is less than the expected &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054983"><span class="hs-identifier hs-var">n0</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; bytes&quot;</span></span><span>
</span><span id="line-219"></span><span>  </span><span class="annot"><a href="#local-6989586621679054980"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Get.Internal.html#Partial"><span class="hs-identifier hs-type">Partial</span></a></span><span> </span><span id="local-6989586621679054973"><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder a
</span><a href="#local-6989586621679054973"><span class="hs-identifier hs-var">resume</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Decoder a -&gt; Get a
</span><a href="#local-6989586621679054980"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder a
</span><a href="#local-6989586621679054973"><span class="hs-identifier hs-var">resume</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ByteString
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-220"></span><span>  </span><span class="annot"><a href="#local-6989586621679054980"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621679054972"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054972"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Get.Internal.html#Partial"><span class="hs-identifier hs-type">Partial</span></a></span><span> </span><span id="local-6989586621679054971"><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder a
</span><a href="#local-6989586621679054971"><span class="hs-identifier hs-var">resume</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-221"></span><span>    </span><span id="local-6989586621679054970"><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="#local-6989586621679054970"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success (Maybe ByteString) r -&gt; Decoder r)
-&gt; Get (Maybe ByteString)
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r.
  ByteString -&gt; Success (Maybe ByteString) r -&gt; Decoder r)
 -&gt; Get (Maybe ByteString))
-&gt; (forall r.
    ByteString -&gt; Success (Maybe ByteString) r -&gt; Decoder r)
-&gt; Get (Maybe ByteString)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054969"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054969"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679054968"><span class="annot"><span class="annottext">Success (Maybe ByteString) r
</span><a href="#local-6989586621679054968"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-222"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679054967"><span class="annot"><span class="annottext">takeLimited :: ByteString -&gt; Decoder r
</span><a href="#local-6989586621679054967"><span class="hs-identifier hs-var hs-var">takeLimited</span></a></span></span><span> </span><span id="local-6989586621679054966"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054966"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-223"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679054965"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054965"><span class="hs-identifier hs-var">inp'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679054964"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054964"><span class="hs-identifier hs-var">out</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; ByteString -&gt; (ByteString, ByteString)
</span><a href="../../bytestring/src/Data.ByteString.html#splitAt"><span class="hs-identifier hs-var">B.splitAt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054972"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054966"><span class="hs-identifier hs-var">str</span></a></span><span>
</span><span id="line-224"></span><span>            </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Success (Maybe ByteString) r
</span><a href="#local-6989586621679054968"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054964"><span class="hs-identifier hs-var">out</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; Maybe ByteString
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054965"><span class="hs-identifier hs-var">inp'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-225"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; Bool
</span><a href="../../bytestring/src/Data.ByteString.html#null"><span class="hs-identifier hs-var">B.null</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054969"><span class="hs-identifier hs-var">inp</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-226"></span><span>        </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Decoder r
</span><a href="#local-6989586621679054967"><span class="hs-identifier hs-var">takeLimited</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054969"><span class="hs-identifier hs-var">inp</span></a></span><span>
</span><span id="line-227"></span><span>        </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Decoder r -&gt; (ByteString -&gt; Decoder r) -&gt; Decoder r
forall a.
ByteString -&gt; Decoder a -&gt; (ByteString -&gt; Decoder a) -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#prompt"><span class="hs-identifier hs-var">prompt</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054969"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Success (Maybe ByteString) r
</span><a href="#local-6989586621679054968"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#empty"><span class="hs-identifier hs-var">B.empty</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ByteString
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Decoder r
</span><a href="#local-6989586621679054967"><span class="hs-identifier hs-var">takeLimited</span></a></span><span>
</span><span id="line-228"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="#local-6989586621679054970"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-229"></span><span>      </span><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Decoder a -&gt; Get a
</span><a href="#local-6989586621679054980"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054972"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder a
</span><a href="#local-6989586621679054971"><span class="hs-identifier hs-var">resume</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ByteString
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-230"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679054961"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054961"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Decoder a -&gt; Get a
</span><a href="#local-6989586621679054980"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054972"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="../../bytestring/src/Data.ByteString.html#length"><span class="hs-identifier hs-var">B.length</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054961"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder a
</span><a href="#local-6989586621679054971"><span class="hs-identifier hs-var">resume</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; Maybe ByteString
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054961"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-231"></span><span>  </span><span class="annot"><a href="#local-6989586621679054980"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-type">Fail</span></a></span><span> </span><span id="local-6989586621679054960"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054960"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span id="local-6989586621679054959"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679054959"><span class="hs-identifier hs-var">err</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Get ()
</span><a href="Data.Binary.Get.Internal.html#pushFront"><span class="hs-identifier hs-var">pushFront</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054960"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="annot"><span class="annottext">Get () -&gt; Get a -&gt; Get a
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Get a
forall (m :: * -&gt; *) a. MonadFail m =&gt; String -&gt; m a
</span><a href="../../base/src/Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679054959"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-232"></span><span>  </span><span class="annot"><a href="#local-6989586621679054980"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621679054958"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054958"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Get.Internal.html#BytesRead"><span class="hs-identifier hs-type">BytesRead</span></a></span><span> </span><span id="local-6989586621679054957"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679054957"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679054956"><span class="annot"><span class="annottext">Int64 -&gt; Decoder a
</span><a href="#local-6989586621679054956"><span class="hs-identifier hs-var">resume</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-233"></span><span>    </span><span class="annot"><span class="annottext">Int -&gt; Decoder a -&gt; Get a
</span><a href="#local-6989586621679054980"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054958"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64 -&gt; Decoder a
</span><a href="#local-6989586621679054956"><span class="hs-identifier hs-var">resume</span></a></span><span> </span><span class="annot"><span class="annottext">(Int64 -&gt; Decoder a) -&gt; Int64 -&gt; Decoder a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int64
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054983"><span class="hs-identifier hs-var">n0</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int64
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054958"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679054957"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-234"></span><span>
</span><span id="line-235"></span><span class="hs-keyword">type</span><span> </span><span id="Consume"><span class="annot"><a href="Data.Binary.Get.Internal.html#Consume"><span class="hs-identifier hs-var">Consume</span></a></span></span><span> </span><span id="local-6989586621679054954"><span class="annot"><a href="#local-6989586621679054954"><span class="hs-identifier hs-type">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="#local-6989586621679054954"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054954"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-236"></span><span>
</span><span id="line-237"></span><span id="local-6989586621679055273"><span id="local-6989586621679055275"><span class="annot"><a href="Data.Binary.Get.Internal.html#withInputChunks"><span class="hs-identifier hs-type">withInputChunks</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679055275"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Consume"><span class="hs-identifier hs-type">Consume</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055275"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055273"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055273"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055273"><span class="hs-identifier hs-type">b</span></a></span></span></span><span>
</span><span id="line-238"></span><span id="withInputChunks"><span class="annot"><span class="annottext">withInputChunks :: forall s b.
s
-&gt; Consume s
-&gt; ([ByteString] -&gt; b)
-&gt; ([ByteString] -&gt; Get b)
-&gt; Get b
</span><a href="Data.Binary.Get.Internal.html#withInputChunks"><span class="hs-identifier hs-var hs-var">withInputChunks</span></a></span></span><span> </span><span id="local-6989586621679054953"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054953"><span class="hs-identifier hs-var">initS</span></a></span></span><span> </span><span id="local-6989586621679054952"><span class="annot"><span class="annottext">Consume s
</span><a href="#local-6989586621679054952"><span class="hs-identifier hs-var">consume</span></a></span></span><span> </span><span id="local-6989586621679054951"><span class="annot"><span class="annottext">[ByteString] -&gt; b
</span><a href="#local-6989586621679054951"><span class="hs-identifier hs-var">onSucc</span></a></span></span><span> </span><span id="local-6989586621679054950"><span class="annot"><span class="annottext">[ByteString] -&gt; Get b
</span><a href="#local-6989586621679054950"><span class="hs-identifier hs-var">onFail</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">s -&gt; [ByteString] -&gt; Get b
</span><a href="#local-6989586621679054949"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054953"><span class="hs-identifier hs-var">initS</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-239"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-240"></span><span>  </span><span id="local-6989586621679054949"><span class="annot"><span class="annottext">go :: s -&gt; [ByteString] -&gt; Get b
</span><a href="#local-6989586621679054949"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679054948"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054948"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span id="local-6989586621679054947"><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054947"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success b r -&gt; Decoder r) -&gt; Get b
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success b r -&gt; Decoder r) -&gt; Get b)
-&gt; (forall r. ByteString -&gt; Success b r -&gt; Decoder r) -&gt; Get b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054946"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054946"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679054945"><span class="annot"><span class="annottext">Success b r
</span><a href="#local-6989586621679054945"><span class="hs-identifier hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-241"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Consume s
</span><a href="#local-6989586621679054952"><span class="hs-identifier hs-var">consume</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054948"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054946"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-242"></span><span>      </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679054944"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054944"><span class="hs-identifier hs-var">state'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-243"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679054943"><span class="annot"><span class="annottext">acc' :: [ByteString]
</span><a href="#local-6989586621679054943"><span class="hs-identifier hs-var hs-var">acc'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054946"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; [ByteString]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054947"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-244"></span><span>        </span><span class="annot"><span class="annottext">Decoder r -&gt; (ByteString -&gt; Decoder r) -&gt; Decoder r
forall a. Decoder a -&gt; (ByteString -&gt; Decoder a) -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#prompt%27"><span class="hs-identifier hs-var">prompt'</span></a></span><span>
</span><span id="line-245"></span><span>          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Get b -&gt; forall r. ByteString -&gt; Success b r -&gt; Decoder r
forall a. Get a -&gt; forall r. ByteString -&gt; Success a r -&gt; Decoder r
</span><a href="Data.Binary.Get.Internal.html#runCont"><span class="hs-identifier hs-var hs-var">runCont</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ByteString] -&gt; Get b
</span><a href="#local-6989586621679054950"><span class="hs-identifier hs-var">onFail</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ByteString] -&gt; [ByteString]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054943"><span class="hs-identifier hs-var">acc'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#empty"><span class="hs-identifier hs-var">B.empty</span></a></span><span> </span><span class="annot"><span class="annottext">Success b r
</span><a href="#local-6989586621679054945"><span class="hs-identifier hs-var">ks</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-246"></span><span>          </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679054941"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054941"><span class="hs-identifier hs-var">str'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Get b -&gt; forall r. ByteString -&gt; Success b r -&gt; Decoder r
forall a. Get a -&gt; forall r. ByteString -&gt; Success a r -&gt; Decoder r
</span><a href="Data.Binary.Get.Internal.html#runCont"><span class="hs-identifier hs-var hs-var">runCont</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">s -&gt; [ByteString] -&gt; Get b
</span><a href="#local-6989586621679054949"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054944"><span class="hs-identifier hs-var">state'</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054943"><span class="hs-identifier hs-var">acc'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054941"><span class="hs-identifier hs-var">str'</span></a></span><span> </span><span class="annot"><span class="annottext">Success b r
</span><a href="#local-6989586621679054945"><span class="hs-identifier hs-var">ks</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-247"></span><span>      </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679054940"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054940"><span class="hs-identifier hs-var">want</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679054939"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054939"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-248"></span><span>        </span><span class="annot"><span class="annottext">Success b r
</span><a href="#local-6989586621679054945"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054939"><span class="hs-identifier hs-var">rest</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ByteString] -&gt; b
</span><a href="#local-6989586621679054951"><span class="hs-identifier hs-var">onSucc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ByteString] -&gt; [ByteString]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054940"><span class="hs-identifier hs-var">want</span></a></span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; [ByteString]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054947"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-249"></span><span>
</span><span id="line-250"></span><span id="local-6989586621679055268"><span class="annot"><a href="Data.Binary.Get.Internal.html#failOnEOF"><span class="hs-identifier hs-type">failOnEOF</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055268"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-251"></span><span id="failOnEOF"><span class="annot"><span class="annottext">failOnEOF :: forall a. [ByteString] -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#failOnEOF"><span class="hs-identifier hs-var hs-var">failOnEOF</span></a></span></span><span> </span><span id="local-6989586621679054938"><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054938"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a)
-&gt; (forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Success a r
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; String -&gt; Decoder r
forall a. ByteString -&gt; String -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ByteString] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#concat"><span class="hs-identifier hs-var">B.concat</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054938"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;not enough bytes&quot;</span></span><span>
</span><span id="line-252"></span><span>
</span><span id="line-253"></span><span class="hs-comment">-- | Test whether all input has been consumed, i.e. there are no remaining</span><span>
</span><span id="line-254"></span><span class="hs-comment">-- undecoded bytes.</span><span>
</span><span id="line-255"></span><span class="annot"><a href="Data.Binary.Get.Internal.html#isEmpty"><span class="hs-identifier hs-type">isEmpty</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-256"></span><span id="isEmpty"><span class="annot"><span class="annottext">isEmpty :: Get Bool
</span><a href="Data.Binary.Get.Internal.html#isEmpty"><span class="hs-identifier hs-var hs-var">isEmpty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success Bool r -&gt; Decoder r) -&gt; Get Bool
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success Bool r -&gt; Decoder r) -&gt; Get Bool)
-&gt; (forall r. ByteString -&gt; Success Bool r -&gt; Decoder r)
-&gt; Get Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054936"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054936"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679054935"><span class="annot"><span class="annottext">Success Bool r
</span><a href="#local-6989586621679054935"><span class="hs-identifier hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-257"></span><span>    </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Bool
</span><a href="../../bytestring/src/Data.ByteString.html#null"><span class="hs-identifier hs-var">B.null</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054936"><span class="hs-identifier hs-var">inp</span></a></span><span>
</span><span id="line-258"></span><span>      </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Decoder r -&gt; (ByteString -&gt; Decoder r) -&gt; Decoder r
forall a.
ByteString -&gt; Decoder a -&gt; (ByteString -&gt; Decoder a) -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#prompt"><span class="hs-identifier hs-var">prompt</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054936"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Success Bool r
</span><a href="#local-6989586621679054935"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054936"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679054934"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054934"><span class="hs-identifier hs-var">inp'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Success Bool r
</span><a href="#local-6989586621679054935"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054934"><span class="hs-identifier hs-var">inp'</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">)</span><span>
</span><span id="line-259"></span><span>      </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Success Bool r
</span><a href="#local-6989586621679054935"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054936"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-260"></span><span>
</span><span id="line-261"></span><span class="hs-comment">-- | DEPRECATED. Same as 'getByteString'.</span><span>
</span><span id="line-262"></span><span class="hs-pragma">{-# DEPRECATED</span><span> </span><span class="hs-pragma">getBytes</span><span> </span><span class="hs-pragma">&quot;Use 'getByteString' instead of 'getBytes'.&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-263"></span><span class="annot"><a href="Data.Binary.Get.Internal.html#getBytes"><span class="hs-identifier hs-type">getBytes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span>
</span><span id="line-264"></span><span id="getBytes"><span class="annot"><span class="annottext">getBytes :: Int -&gt; Get ByteString
</span><a href="Data.Binary.Get.Internal.html#getBytes"><span class="hs-identifier hs-var hs-var">getBytes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span>
</span><span id="line-265"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#getBytes"><span class="hs-pragma hs-type">getBytes</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-266"></span><span>
</span><span id="line-267"></span><span class="hs-comment">-- | @since 0.7.0.0</span><span>
</span><span id="line-268"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Alternative"><span class="hs-identifier hs-type">Alternative</span></a></span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-269"></span><span>  </span><span id="local-6989586621679054926"><span class="annot"><span class="annottext">empty :: forall a. Get a
</span><a href="#local-6989586621679054926"><span class="hs-identifier hs-var hs-var hs-var hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a)
-&gt; (forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054925"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054925"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679054924"><span class="annot"><span class="annottext">Success a r
</span><a href="#local-6989586621679054924"><span class="hs-identifier hs-var">_ks</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; String -&gt; Decoder r
forall a. ByteString -&gt; String -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054925"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Data.Binary.Get(Alternative).empty&quot;</span></span><span>
</span><span id="line-270"></span><span>  </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#empty"><span class="hs-pragma hs-type">empty</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-271"></span><span>  </span><span id="local-6989586621679054919"><span class="annot"><span class="annottext">&lt;|&gt; :: forall a. Get a -&gt; Get a -&gt; Get a
</span><a href="#local-6989586621679054919"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;|&gt;)</span></a></span></span><span> </span><span id="local-6989586621679054918"><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679054918"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679054917"><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679054917"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-272"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679054916"><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679054916"><span class="hs-identifier hs-var">decoder</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679054915"><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054915"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get a -&gt; Get (Decoder a, [ByteString])
forall a. Get a -&gt; Get (Decoder a, [ByteString])
</span><a href="Data.Binary.Get.Internal.html#runAndKeepTrack"><span class="hs-identifier hs-var">runAndKeepTrack</span></a></span><span> </span><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679054918"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-273"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679054916"><span class="hs-identifier hs-var">decoder</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-274"></span><span>      </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Done"><span class="hs-identifier hs-type">Done</span></a></span><span> </span><span id="local-6989586621679054913"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054913"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679054912"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054912"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a)
-&gt; (forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679054911"><span class="annot"><span class="annottext">Success a r
</span><a href="#local-6989586621679054911"><span class="hs-identifier hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Success a r
</span><a href="#local-6989586621679054911"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054913"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054912"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-275"></span><span>      </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-type">Fail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; Get ()
</span><a href="Data.Binary.Get.Internal.html#pushBack"><span class="hs-identifier hs-var">pushBack</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054915"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="annot"><span class="annottext">Get () -&gt; Get a -&gt; Get a
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679054917"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-276"></span><span>      </span><span class="annot"><span class="annottext">Decoder a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Get a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Binary: impossible&quot;</span></span><span>
</span><span id="line-277"></span><span>  </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&lt;|&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-278"></span><span>  </span><span id="local-6989586621679054905"><span class="annot"><span class="annottext">some :: forall a. Get a -&gt; Get [a]
</span><a href="../../base/src/GHC.Base.html#some"><span class="hs-identifier hs-var hs-var hs-var hs-var">some</span></a></span></span><span> </span><span id="local-6989586621679054903"><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679054903"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">:</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(a -&gt; [a] -&gt; [a]) -&gt; Get a -&gt; Get ([a] -&gt; [a])
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679054903"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Get ([a] -&gt; [a]) -&gt; Get [a] -&gt; Get [a]
forall (f :: * -&gt; *) a b. Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Get a -&gt; Get [a]
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f [a]
</span><a href="../../base/src/GHC.Base.html#many"><span class="hs-identifier hs-var">many</span></a></span><span> </span><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679054903"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-279"></span><span>  </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#some"><span class="hs-pragma hs-type">some</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-280"></span><span>  </span><span id="local-6989586621679054893"><span class="annot"><span class="annottext">many :: forall a. Get a -&gt; Get [a]
</span><a href="#local-6989586621679054893"><span class="hs-identifier hs-var hs-var hs-var hs-var">many</span></a></span></span><span> </span><span id="local-6989586621679054892"><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679054892"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-281"></span><span>    </span><span id="local-6989586621679054891"><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679054891"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Maybe a
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; Maybe a) -&gt; Get a -&gt; Get (Maybe a)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679054892"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Get (Maybe a) -&gt; Get (Maybe a) -&gt; Get (Maybe a)
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe a -&gt; Get (Maybe a)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe a
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-282"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679054891"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-283"></span><span>      </span><span class="annot"><span class="annottext">Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; Get [a]
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-284"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679054890"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054890"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">:</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054890"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [a]) -&gt; Get [a] -&gt; Get [a]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Get a -&gt; Get [a]
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f [a]
</span><a href="../../base/src/GHC.Base.html#many"><span class="hs-identifier hs-var">many</span></a></span><span> </span><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679054892"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-285"></span><span>  </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#many"><span class="hs-pragma hs-type">many</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-286"></span><span>
</span><span id="line-287"></span><span class="hs-comment">-- | Run a decoder and keep track of all the input it consumes.</span><span>
</span><span id="line-288"></span><span class="hs-comment">-- Once it's finished, return the final decoder (always 'Done' or 'Fail'),</span><span>
</span><span id="line-289"></span><span class="hs-comment">-- and unconsume all the the input the decoder required to run.</span><span>
</span><span id="line-290"></span><span class="hs-comment">-- Any additional chunks which was required to run the decoder</span><span>
</span><span id="line-291"></span><span class="hs-comment">-- will also be returned.</span><span>
</span><span id="line-292"></span><span id="local-6989586621679055259"><span class="annot"><a href="Data.Binary.Get.Internal.html#runAndKeepTrack"><span class="hs-identifier hs-type">runAndKeepTrack</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055259"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Get.Internal.html#Decoder"><span class="hs-identifier hs-type">Decoder</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055259"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span></span><span>
</span><span id="line-293"></span><span id="runAndKeepTrack"><span class="annot"><span class="annottext">runAndKeepTrack :: forall a. Get a -&gt; Get (Decoder a, [ByteString])
</span><a href="Data.Binary.Get.Internal.html#runAndKeepTrack"><span class="hs-identifier hs-var hs-var">runAndKeepTrack</span></a></span></span><span> </span><span id="local-6989586621679054889"><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679054889"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall r.
 ByteString -&gt; Success (Decoder a, [ByteString]) r -&gt; Decoder r)
-&gt; Get (Decoder a, [ByteString])
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r.
  ByteString -&gt; Success (Decoder a, [ByteString]) r -&gt; Decoder r)
 -&gt; Get (Decoder a, [ByteString]))
-&gt; (forall r.
    ByteString -&gt; Success (Decoder a, [ByteString]) r -&gt; Decoder r)
-&gt; Get (Decoder a, [ByteString])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054888"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054888"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679054887"><span class="annot"><span class="annottext">Success (Decoder a, [ByteString]) r
</span><a href="#local-6989586621679054887"><span class="hs-identifier hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-294"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679054886"><span class="annot"><span class="annottext">r0 :: Decoder a
</span><a href="#local-6989586621679054886"><span class="hs-identifier hs-var hs-var">r0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Get a -&gt; forall r. ByteString -&gt; Success a r -&gt; Decoder r
forall a. Get a -&gt; forall r. ByteString -&gt; Success a r -&gt; Decoder r
</span><a href="Data.Binary.Get.Internal.html#runCont"><span class="hs-identifier hs-var hs-var">runCont</span></a></span><span> </span><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679054889"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054888"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679054885"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054885"><span class="hs-identifier hs-var">inp'</span></a></span></span><span> </span><span id="local-6989586621679054884"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054884"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Success a a
forall a. ByteString -&gt; a -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Done"><span class="hs-identifier hs-var">Done</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054885"><span class="hs-identifier hs-var">inp'</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054884"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-295"></span><span>      </span><span id="local-6989586621679054883"><span class="annot"><span class="annottext">go :: [ByteString] -&gt; Decoder a -&gt; Decoder r
</span><a href="#local-6989586621679054883"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679054882"><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054882"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span id="local-6989586621679054881"><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679054881"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679054881"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-296"></span><span>                    </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Done"><span class="hs-identifier hs-type">Done</span></a></span><span> </span><span id="local-6989586621679054880"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054880"><span class="hs-identifier hs-var">inp'</span></a></span></span><span> </span><span id="local-6989586621679054879"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054879"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Success (Decoder a, [ByteString]) r
</span><a href="#local-6989586621679054887"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054888"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Success a a
forall a. ByteString -&gt; a -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Done"><span class="hs-identifier hs-var">Done</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054880"><span class="hs-identifier hs-var">inp'</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054879"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; [ByteString]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054882"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-297"></span><span>                    </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Partial"><span class="hs-identifier hs-type">Partial</span></a></span><span> </span><span id="local-6989586621679054878"><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder a
</span><a href="#local-6989586621679054878"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Maybe ByteString -&gt; Decoder r) -&gt; Decoder r
forall a. (Maybe ByteString -&gt; Decoder a) -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Partial"><span class="hs-identifier hs-var">Partial</span></a></span><span> </span><span class="annot"><span class="annottext">((Maybe ByteString -&gt; Decoder r) -&gt; Decoder r)
-&gt; (Maybe ByteString -&gt; Decoder r) -&gt; Decoder r
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054877"><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="#local-6989586621679054877"><span class="hs-identifier hs-var">minp</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; Decoder a -&gt; Decoder r
</span><a href="#local-6989586621679054883"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ByteString]
-&gt; (ByteString -&gt; [ByteString]) -&gt; Maybe ByteString -&gt; [ByteString]
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="../../base/src/Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054882"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; [ByteString]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054882"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="#local-6989586621679054877"><span class="hs-identifier hs-var">minp</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder a
</span><a href="#local-6989586621679054878"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="#local-6989586621679054877"><span class="hs-identifier hs-var">minp</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-298"></span><span>                    </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-type">Fail</span></a></span><span> </span><span id="local-6989586621679054875"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054875"><span class="hs-identifier hs-var">inp'</span></a></span></span><span> </span><span id="local-6989586621679054874"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679054874"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Success (Decoder a, [ByteString]) r
</span><a href="#local-6989586621679054887"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054888"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; String -&gt; Decoder a
forall a. ByteString -&gt; String -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054875"><span class="hs-identifier hs-var">inp'</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679054874"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; [ByteString]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054882"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-299"></span><span>                    </span><span class="annot"><a href="Data.Binary.Get.Internal.html#BytesRead"><span class="hs-identifier hs-type">BytesRead</span></a></span><span> </span><span id="local-6989586621679054873"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679054873"><span class="hs-identifier hs-var">unused</span></a></span></span><span> </span><span id="local-6989586621679054872"><span class="annot"><span class="annottext">Int64 -&gt; Decoder a
</span><a href="#local-6989586621679054872"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; (Int64 -&gt; Decoder r) -&gt; Decoder r
forall a. Int64 -&gt; (Int64 -&gt; Decoder a) -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#BytesRead"><span class="hs-identifier hs-var">BytesRead</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679054873"><span class="hs-identifier hs-var">unused</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ByteString] -&gt; Decoder a -&gt; Decoder r
</span><a href="#local-6989586621679054883"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054882"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">(Decoder a -&gt; Decoder r)
-&gt; (Int64 -&gt; Decoder a) -&gt; Int64 -&gt; Decoder r
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Decoder a
</span><a href="#local-6989586621679054872"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-300"></span><span>  </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; Decoder a -&gt; Decoder r
</span><a href="#local-6989586621679054883"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679054886"><span class="hs-identifier hs-var">r0</span></a></span><span>
</span><span id="line-301"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#runAndKeepTrack"><span class="hs-pragma hs-type">runAndKeepTrack</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-302"></span><span>
</span><span id="line-303"></span><span class="annot"><a href="Data.Binary.Get.Internal.html#pushBack"><span class="hs-identifier hs-type">pushBack</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-304"></span><span id="pushBack"><span class="annot"><span class="annottext">pushBack :: [ByteString] -&gt; Get ()
</span><a href="Data.Binary.Get.Internal.html#pushBack"><span class="hs-identifier hs-var hs-var">pushBack</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success () r -&gt; Decoder r) -&gt; Get ()
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success () r -&gt; Decoder r) -&gt; Get ())
-&gt; (forall r. ByteString -&gt; Success () r -&gt; Decoder r) -&gt; Get ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679054871"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054871"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679054870"><span class="annot"><span class="annottext">Success () r
</span><a href="#local-6989586621679054870"><span class="hs-identifier hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Success () r
</span><a href="#local-6989586621679054870"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054871"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-305"></span><span class="annot"><a href="Data.Binary.Get.Internal.html#pushBack"><span class="hs-identifier hs-var">pushBack</span></a></span><span> </span><span id="local-6989586621679054869"><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054869"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success () r -&gt; Decoder r) -&gt; Get ()
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success () r -&gt; Decoder r) -&gt; Get ())
-&gt; (forall r. ByteString -&gt; Success () r -&gt; Decoder r) -&gt; Get ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679054868"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054868"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679054867"><span class="annot"><span class="annottext">Success () r
</span><a href="#local-6989586621679054867"><span class="hs-identifier hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Success () r
</span><a href="#local-6989586621679054867"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ByteString] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#concat"><span class="hs-identifier hs-var">B.concat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054868"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; [ByteString]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054869"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-306"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#pushBack"><span class="hs-pragma hs-type">pushBack</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-307"></span><span>
</span><span id="line-308"></span><span class="annot"><a href="Data.Binary.Get.Internal.html#pushFront"><span class="hs-identifier hs-type">pushFront</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-309"></span><span id="pushFront"><span class="annot"><span class="annottext">pushFront :: ByteString -&gt; Get ()
</span><a href="Data.Binary.Get.Internal.html#pushFront"><span class="hs-identifier hs-var hs-var">pushFront</span></a></span></span><span> </span><span id="local-6989586621679054866"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054866"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success () r -&gt; Decoder r) -&gt; Get ()
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success () r -&gt; Decoder r) -&gt; Get ())
-&gt; (forall r. ByteString -&gt; Success () r -&gt; Decoder r) -&gt; Get ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679054865"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054865"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679054864"><span class="annot"><span class="annottext">Success () r
</span><a href="#local-6989586621679054864"><span class="hs-identifier hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Success () r
</span><a href="#local-6989586621679054864"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#append"><span class="hs-identifier hs-var">B.append</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054866"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054865"><span class="hs-identifier hs-var">inp</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-310"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#pushFront"><span class="hs-pragma hs-type">pushFront</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-311"></span><span>
</span><span id="line-312"></span><span class="hs-comment">-- | Run the given decoder, but without consuming its input. If the given</span><span>
</span><span id="line-313"></span><span class="hs-comment">-- decoder fails, then so will this function.</span><span>
</span><span id="line-314"></span><span class="hs-comment">--</span><span>
</span><span id="line-315"></span><span class="hs-comment">-- @since 0.7.0.0</span><span>
</span><span id="line-316"></span><span id="local-6989586621679055243"><span class="annot"><a href="Data.Binary.Get.Internal.html#lookAhead"><span class="hs-identifier hs-type">lookAhead</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055243"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055243"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-317"></span><span id="lookAhead"><span class="annot"><span class="annottext">lookAhead :: forall a. Get a -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#lookAhead"><span class="hs-identifier hs-var hs-var">lookAhead</span></a></span></span><span> </span><span id="local-6989586621679054858"><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679054858"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-318"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621679054857"><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679054857"><span class="hs-identifier hs-var">decoder</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679054856"><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054856"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get a -&gt; Get (Decoder a, [ByteString])
forall a. Get a -&gt; Get (Decoder a, [ByteString])
</span><a href="Data.Binary.Get.Internal.html#runAndKeepTrack"><span class="hs-identifier hs-var">runAndKeepTrack</span></a></span><span> </span><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679054858"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-319"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679054857"><span class="hs-identifier hs-var">decoder</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-320"></span><span>    </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Done"><span class="hs-identifier hs-type">Done</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679054855"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054855"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; Get ()
</span><a href="Data.Binary.Get.Internal.html#pushBack"><span class="hs-identifier hs-var">pushBack</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054856"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="annot"><span class="annottext">Get () -&gt; Get a -&gt; Get a
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Get a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054855"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-321"></span><span>    </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-type">Fail</span></a></span><span> </span><span id="local-6989586621679054854"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054854"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679054853"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679054853"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a)
-&gt; (forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Success a r
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; String -&gt; Decoder r
forall a. ByteString -&gt; String -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054854"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679054853"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-322"></span><span>    </span><span class="annot"><span class="annottext">Decoder a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Get a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Binary: impossible&quot;</span></span><span>
</span><span id="line-323"></span><span>
</span><span id="line-324"></span><span class="hs-comment">-- | Run the given decoder, and only consume its input if it returns 'Just'.</span><span>
</span><span id="line-325"></span><span class="hs-comment">-- If 'Nothing' is returned, the input will be unconsumed.</span><span>
</span><span id="line-326"></span><span class="hs-comment">-- If the given decoder fails, then so will this function.</span><span>
</span><span id="line-327"></span><span class="hs-comment">--</span><span>
</span><span id="line-328"></span><span class="hs-comment">-- @since 0.7.0.0</span><span>
</span><span id="line-329"></span><span id="local-6989586621679055240"><span class="annot"><a href="Data.Binary.Get.Internal.html#lookAheadM"><span class="hs-identifier hs-type">lookAheadM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055240"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055240"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-330"></span><span id="lookAheadM"><span class="annot"><span class="annottext">lookAheadM :: forall a. Get (Maybe a) -&gt; Get (Maybe a)
</span><a href="Data.Binary.Get.Internal.html#lookAheadM"><span class="hs-identifier hs-var hs-var">lookAheadM</span></a></span></span><span> </span><span id="local-6989586621679054850"><span class="annot"><span class="annottext">Get (Maybe a)
</span><a href="#local-6989586621679054850"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-331"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679054849"><span class="annot"><span class="annottext">g' :: Get (Either () a)
</span><a href="#local-6989586621679054849"><span class="hs-identifier hs-var hs-var">g'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Either () a -&gt; (a -&gt; Either () a) -&gt; Maybe a -&gt; Either () a
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="../../base/src/Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; Either () a
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a -&gt; Either () a
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe a -&gt; Either () a) -&gt; Get (Maybe a) -&gt; Get (Either () a)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Get (Maybe a)
</span><a href="#local-6989586621679054850"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-332"></span><span>  </span><span class="annot"><span class="annottext">(() -&gt; Maybe a) -&gt; (a -&gt; Maybe a) -&gt; Either () a -&gt; Maybe a
forall a c b. (a -&gt; c) -&gt; (b -&gt; c) -&gt; Either a b -&gt; c
</span><a href="../../base/src/Data.Either.html#either"><span class="hs-identifier hs-var">either</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe a -&gt; () -&gt; Maybe a
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe a
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a -&gt; Maybe a
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(Either () a -&gt; Maybe a) -&gt; Get (Either () a) -&gt; Get (Maybe a)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Get (Either () a) -&gt; Get (Either () a)
forall a b. Get (Either a b) -&gt; Get (Either a b)
</span><a href="Data.Binary.Get.Internal.html#lookAheadE"><span class="hs-identifier hs-var">lookAheadE</span></a></span><span> </span><span class="annot"><span class="annottext">Get (Either () a)
</span><a href="#local-6989586621679054849"><span class="hs-identifier hs-var">g'</span></a></span><span>
</span><span id="line-333"></span><span>
</span><span id="line-334"></span><span class="hs-comment">-- | Run the given decoder, and only consume its input if it returns 'Right'.</span><span>
</span><span id="line-335"></span><span class="hs-comment">-- If 'Left' is returned, the input will be unconsumed.</span><span>
</span><span id="line-336"></span><span class="hs-comment">-- If the given decoder fails, then so will this function.</span><span>
</span><span id="line-337"></span><span class="hs-comment">--</span><span>
</span><span id="line-338"></span><span class="hs-comment">-- @since 0.7.1.0</span><span>
</span><span id="line-339"></span><span id="local-6989586621679055230"><span id="local-6989586621679055231"><span class="annot"><a href="Data.Binary.Get.Internal.html#lookAheadE"><span class="hs-identifier hs-type">lookAheadE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055231"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055230"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055231"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055230"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-340"></span><span id="lookAheadE"><span class="annot"><span class="annottext">lookAheadE :: forall a b. Get (Either a b) -&gt; Get (Either a b)
</span><a href="Data.Binary.Get.Internal.html#lookAheadE"><span class="hs-identifier hs-var hs-var">lookAheadE</span></a></span></span><span> </span><span id="local-6989586621679054841"><span class="annot"><span class="annottext">Get (Either a b)
</span><a href="#local-6989586621679054841"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-341"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621679054840"><span class="annot"><span class="annottext">Decoder (Either a b)
</span><a href="#local-6989586621679054840"><span class="hs-identifier hs-var">decoder</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679054839"><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054839"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get (Either a b) -&gt; Get (Decoder (Either a b), [ByteString])
forall a. Get a -&gt; Get (Decoder a, [ByteString])
</span><a href="Data.Binary.Get.Internal.html#runAndKeepTrack"><span class="hs-identifier hs-var">runAndKeepTrack</span></a></span><span> </span><span class="annot"><span class="annottext">Get (Either a b)
</span><a href="#local-6989586621679054841"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-342"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Decoder (Either a b)
</span><a href="#local-6989586621679054840"><span class="hs-identifier hs-var">decoder</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-343"></span><span>    </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Done"><span class="hs-identifier hs-type">Done</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679054838"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054838"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; Get ()
</span><a href="Data.Binary.Get.Internal.html#pushBack"><span class="hs-identifier hs-var">pushBack</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054839"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="annot"><span class="annottext">Get () -&gt; Get (Either a b) -&gt; Get (Either a b)
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Either a b -&gt; Get (Either a b)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Either a b
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054838"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-344"></span><span>    </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Done"><span class="hs-identifier hs-type">Done</span></a></span><span> </span><span id="local-6989586621679054837"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054837"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679054836"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679054836"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success (Either a b) r -&gt; Decoder r)
-&gt; Get (Either a b)
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success (Either a b) r -&gt; Decoder r)
 -&gt; Get (Either a b))
-&gt; (forall r. ByteString -&gt; Success (Either a b) r -&gt; Decoder r)
-&gt; Get (Either a b)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679054835"><span class="annot"><span class="annottext">Success (Either a b) r
</span><a href="#local-6989586621679054835"><span class="hs-identifier hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Success (Either a b) r
</span><a href="#local-6989586621679054835"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054837"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; Either a b
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679054836"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-345"></span><span>    </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-type">Fail</span></a></span><span> </span><span id="local-6989586621679054834"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054834"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679054833"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679054833"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success (Either a b) r -&gt; Decoder r)
-&gt; Get (Either a b)
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success (Either a b) r -&gt; Decoder r)
 -&gt; Get (Either a b))
-&gt; (forall r. ByteString -&gt; Success (Either a b) r -&gt; Decoder r)
-&gt; Get (Either a b)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Success (Either a b) r
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; String -&gt; Decoder r
forall a. ByteString -&gt; String -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054834"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679054833"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-346"></span><span>    </span><span class="annot"><span class="annottext">Decoder (Either a b)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Get (Either a b)
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Binary: impossible&quot;</span></span><span>
</span><span id="line-347"></span><span>
</span><span id="line-348"></span><span class="hs-comment">-- | Label a decoder. If the decoder fails, the label will be appended on</span><span>
</span><span id="line-349"></span><span class="hs-comment">-- a new line to the error message string.</span><span>
</span><span id="line-350"></span><span class="hs-comment">--</span><span>
</span><span id="line-351"></span><span class="hs-comment">-- @since 0.7.2.0</span><span>
</span><span id="line-352"></span><span id="local-6989586621679055225"><span class="annot"><a href="Data.Binary.Get.Internal.html#label"><span class="hs-identifier hs-type">label</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055225"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055225"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-353"></span><span id="label"><span class="annot"><span class="annottext">label :: forall a. String -&gt; Get a -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#label"><span class="hs-identifier hs-var hs-var">label</span></a></span></span><span> </span><span id="local-6989586621679054832"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679054832"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span id="local-6989586621679054831"><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679054831"><span class="hs-identifier hs-var">decoder</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a)
-&gt; (forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054830"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054830"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679054829"><span class="annot"><span class="annottext">Success a r
</span><a href="#local-6989586621679054829"><span class="hs-identifier hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-354"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679054828"><span class="annot"><span class="annottext">r0 :: Decoder a
</span><a href="#local-6989586621679054828"><span class="hs-identifier hs-var hs-var">r0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Get a -&gt; forall r. ByteString -&gt; Success a r -&gt; Decoder r
forall a. Get a -&gt; forall r. ByteString -&gt; Success a r -&gt; Decoder r
</span><a href="Data.Binary.Get.Internal.html#runCont"><span class="hs-identifier hs-var hs-var">runCont</span></a></span><span> </span><span class="annot"><span class="annottext">Get a
</span><a href="#local-6989586621679054831"><span class="hs-identifier hs-var">decoder</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054830"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679054827"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054827"><span class="hs-identifier hs-var">inp'</span></a></span></span><span> </span><span id="local-6989586621679054826"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054826"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Success a a
forall a. ByteString -&gt; a -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Done"><span class="hs-identifier hs-var">Done</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054827"><span class="hs-identifier hs-var">inp'</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054826"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-355"></span><span>      </span><span id="local-6989586621679054825"><span class="annot"><span class="annottext">go :: Decoder a -&gt; Decoder r
</span><a href="#local-6989586621679054825"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679054824"><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679054824"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679054824"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-356"></span><span>                 </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Done"><span class="hs-identifier hs-type">Done</span></a></span><span> </span><span id="local-6989586621679054823"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054823"><span class="hs-identifier hs-var">inp'</span></a></span></span><span> </span><span id="local-6989586621679054822"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054822"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Success a r
</span><a href="#local-6989586621679054829"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054823"><span class="hs-identifier hs-var">inp'</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054822"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-357"></span><span>                 </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Partial"><span class="hs-identifier hs-type">Partial</span></a></span><span> </span><span id="local-6989586621679054821"><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder a
</span><a href="#local-6989586621679054821"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Maybe ByteString -&gt; Decoder r) -&gt; Decoder r
forall a. (Maybe ByteString -&gt; Decoder a) -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Partial"><span class="hs-identifier hs-var">Partial</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Decoder a -&gt; Decoder r
</span><a href="#local-6989586621679054825"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">(Decoder a -&gt; Decoder r)
-&gt; (Maybe ByteString -&gt; Decoder a) -&gt; Maybe ByteString -&gt; Decoder r
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder a
</span><a href="#local-6989586621679054821"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-358"></span><span>                 </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-type">Fail</span></a></span><span> </span><span id="local-6989586621679054820"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054820"><span class="hs-identifier hs-var">inp'</span></a></span></span><span> </span><span id="local-6989586621679054819"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679054819"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; String -&gt; Decoder r
forall a. ByteString -&gt; String -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054820"><span class="hs-identifier hs-var">inp'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679054819"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\n&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679054832"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-359"></span><span>                 </span><span class="annot"><a href="Data.Binary.Get.Internal.html#BytesRead"><span class="hs-identifier hs-type">BytesRead</span></a></span><span> </span><span id="local-6989586621679054818"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679054818"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679054817"><span class="annot"><span class="annottext">Int64 -&gt; Decoder a
</span><a href="#local-6989586621679054817"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; (Int64 -&gt; Decoder r) -&gt; Decoder r
forall a. Int64 -&gt; (Int64 -&gt; Decoder a) -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#BytesRead"><span class="hs-identifier hs-var">BytesRead</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679054818"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Decoder a -&gt; Decoder r
</span><a href="#local-6989586621679054825"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">(Decoder a -&gt; Decoder r)
-&gt; (Int64 -&gt; Decoder a) -&gt; Int64 -&gt; Decoder r
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Decoder a
</span><a href="#local-6989586621679054817"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-360"></span><span>  </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Decoder a -&gt; Decoder r
</span><a href="#local-6989586621679054825"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Decoder a
</span><a href="#local-6989586621679054828"><span class="hs-identifier hs-var">r0</span></a></span><span>
</span><span id="line-361"></span><span>
</span><span id="line-362"></span><span class="hs-comment">-- | DEPRECATED. Get the number of bytes of remaining input.</span><span>
</span><span id="line-363"></span><span class="hs-comment">-- Note that this is an expensive function to use as in order to calculate how</span><span>
</span><span id="line-364"></span><span class="hs-comment">-- much input remains, all input has to be read and kept in-memory.</span><span>
</span><span id="line-365"></span><span class="hs-comment">-- The decoder keeps the input as a strict bytestring, so you are likely better</span><span>
</span><span id="line-366"></span><span class="hs-comment">-- off by calculating the remaining input in another way.</span><span>
</span><span id="line-367"></span><span class="hs-pragma">{-# DEPRECATED</span><span> </span><span class="hs-pragma">remaining</span><span> </span><span class="hs-pragma">&quot;This will force all remaining input, don't use it.&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-368"></span><span class="annot"><a href="Data.Binary.Get.Internal.html#remaining"><span class="hs-identifier hs-type">remaining</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span>
</span><span id="line-369"></span><span id="remaining"><span class="annot"><span class="annottext">remaining :: Get Int64
</span><a href="Data.Binary.Get.Internal.html#remaining"><span class="hs-identifier hs-var hs-var">remaining</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success Int64 r -&gt; Decoder r) -&gt; Get Int64
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success Int64 r -&gt; Decoder r)
 -&gt; Get Int64)
-&gt; (forall r. ByteString -&gt; Success Int64 r -&gt; Decoder r)
-&gt; Get Int64
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679054814"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054814"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679054813"><span class="annot"><span class="annottext">Success Int64 r
</span><a href="#local-6989586621679054813"><span class="hs-identifier hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-370"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679054812"><span class="annot"><span class="annottext">loop :: [ByteString] -&gt; Decoder r
</span><a href="#local-6989586621679054812"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span id="local-6989586621679054811"><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054811"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Maybe ByteString -&gt; Decoder r) -&gt; Decoder r
forall a. (Maybe ByteString -&gt; Decoder a) -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Partial"><span class="hs-identifier hs-var">Partial</span></a></span><span> </span><span class="annot"><span class="annottext">((Maybe ByteString -&gt; Decoder r) -&gt; Decoder r)
-&gt; (Maybe ByteString -&gt; Decoder r) -&gt; Decoder r
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679054810"><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="#local-6989586621679054810"><span class="hs-identifier hs-var">minp</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-371"></span><span>                  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="#local-6989586621679054810"><span class="hs-identifier hs-var">minp</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-372"></span><span>                    </span><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679054809"><span class="annot"><span class="annottext">all_inp :: ByteString
</span><a href="#local-6989586621679054809"><span class="hs-identifier hs-var hs-var">all_inp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#concat"><span class="hs-identifier hs-var">B.concat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054814"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; [ByteString]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ByteString] -&gt; [ByteString]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054811"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-373"></span><span>                               </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Success Int64 r
</span><a href="#local-6989586621679054813"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054809"><span class="hs-identifier hs-var">all_inp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int64
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">(Int -&gt; Int64) -&gt; Int -&gt; Int64
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="../../bytestring/src/Data.ByteString.html#length"><span class="hs-identifier hs-var">B.length</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054809"><span class="hs-identifier hs-var">all_inp</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-374"></span><span>                    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679054808"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054808"><span class="hs-identifier hs-var">inp'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; Decoder r
</span><a href="#local-6989586621679054812"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054808"><span class="hs-identifier hs-var">inp'</span></a></span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString] -&gt; [ByteString]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054811"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-375"></span><span>  </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; Decoder r
</span><a href="#local-6989586621679054812"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-376"></span><span>
</span><span id="line-377"></span><span class="hs-comment">------------------------------------------------------------------------</span><span>
</span><span id="line-378"></span><span class="hs-comment">-- ByteStrings</span><span>
</span><span id="line-379"></span><span class="hs-comment">--</span><span>
</span><span id="line-380"></span><span>
</span><span id="line-381"></span><span class="hs-comment">-- | An efficient get method for strict ByteStrings. Fails if fewer than @n@</span><span>
</span><span id="line-382"></span><span class="hs-comment">-- bytes are left in the input. If @n &lt;= 0@ then the empty string is returned.</span><span>
</span><span id="line-383"></span><span class="annot"><a href="Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-type">getByteString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span>
</span><span id="line-384"></span><span id="getByteString"><span class="annot"><span class="annottext">getByteString :: Int -&gt; Get ByteString
</span><a href="Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var hs-var">getByteString</span></a></span></span><span> </span><span id="local-6989586621679054807"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054807"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054807"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; (ByteString -&gt; ByteString) -&gt; Get ByteString
forall a. Int -&gt; (ByteString -&gt; a) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#readN"><span class="hs-identifier hs-var">readN</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054807"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Unsafe.html#unsafeTake"><span class="hs-identifier hs-var">B.unsafeTake</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054807"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-385"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Get ByteString
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#empty"><span class="hs-identifier hs-var">B.empty</span></a></span><span>
</span><span id="line-386"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#getByteString"><span class="hs-pragma hs-type">getByteString</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-387"></span><span>
</span><span id="line-388"></span><span class="hs-comment">-- | Get the current chunk.</span><span>
</span><span id="line-389"></span><span class="annot"><a href="Data.Binary.Get.Internal.html#get"><span class="hs-identifier hs-type">get</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span>
</span><span id="line-390"></span><span id="get"><span class="annot"><span class="annottext">get :: Get ByteString
</span><a href="Data.Binary.Get.Internal.html#get"><span class="hs-identifier hs-var hs-var">get</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success ByteString r -&gt; Decoder r)
-&gt; Get ByteString
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success ByteString r -&gt; Decoder r)
 -&gt; Get ByteString)
-&gt; (forall r. ByteString -&gt; Success ByteString r -&gt; Decoder r)
-&gt; Get ByteString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054804"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054804"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679054803"><span class="annot"><span class="annottext">Success ByteString r
</span><a href="#local-6989586621679054803"><span class="hs-identifier hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Success ByteString r
</span><a href="#local-6989586621679054803"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054804"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054804"><span class="hs-identifier hs-var">inp</span></a></span><span>
</span><span id="line-391"></span><span>
</span><span id="line-392"></span><span class="hs-comment">-- | Replace the current chunk.</span><span>
</span><span id="line-393"></span><span class="annot"><a href="Data.Binary.Get.Internal.html#put"><span class="hs-identifier hs-type">put</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-394"></span><span id="put"><span class="annot"><span class="annottext">put :: ByteString -&gt; Get ()
</span><a href="Data.Binary.Get.Internal.html#put"><span class="hs-identifier hs-var hs-var">put</span></a></span></span><span> </span><span id="local-6989586621679054802"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054802"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success () r -&gt; Decoder r) -&gt; Get ()
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success () r -&gt; Decoder r) -&gt; Get ())
-&gt; (forall r. ByteString -&gt; Success () r -&gt; Decoder r) -&gt; Get ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054801"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054801"><span class="hs-identifier hs-var">_inp</span></a></span></span><span> </span><span id="local-6989586621679054800"><span class="annot"><span class="annottext">Success () r
</span><a href="#local-6989586621679054800"><span class="hs-identifier hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Success () r
</span><a href="#local-6989586621679054800"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054802"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-395"></span><span>
</span><span id="line-396"></span><span class="hs-comment">-- | Return at least @n@ bytes, maybe more. If not enough data is available</span><span>
</span><span id="line-397"></span><span class="hs-comment">-- the computation will escape with 'Partial'.</span><span>
</span><span id="line-398"></span><span id="local-6989586621679055221"><span class="annot"><a href="Data.Binary.Get.Internal.html#readN"><span class="hs-identifier hs-type">readN</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055221"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055221"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-399"></span><span id="readN"><span class="annot"><span class="annottext">readN :: forall a. Int -&gt; (ByteString -&gt; a) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#readN"><span class="hs-identifier hs-var hs-var">readN</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679054798"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054798"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679054797"><span class="annot"><span class="annottext">ByteString -&gt; a
</span><a href="#local-6989586621679054797"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ()
</span><a href="Data.Binary.Get.Internal.html#ensureN"><span class="hs-identifier hs-var">ensureN</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054798"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Get () -&gt; Get a -&gt; Get a
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; (ByteString -&gt; a) -&gt; Get a
forall a. Int -&gt; (ByteString -&gt; a) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#unsafeReadN"><span class="hs-identifier hs-var">unsafeReadN</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054798"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; a
</span><a href="#local-6989586621679054797"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-400"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">0</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#readN"><span class="hs-pragma hs-type">readN</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-401"></span><span>
</span><span id="line-402"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-403"></span><span>
</span><span id="line-404"></span><span class="annot"><span class="hs-pragma">&quot;readN/readN merge&quot;</span></span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679054795"><span class="annot"><a href="#local-6989586621679054795"><span class="hs-pragma hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679054794"><span class="annot"><a href="#local-6989586621679054794"><span class="hs-pragma hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679054793"><span class="annot"><a href="#local-6989586621679054793"><span class="hs-pragma hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679054792"><span class="annot"><a href="#local-6989586621679054792"><span class="hs-pragma hs-var">g</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-405"></span><span>  </span><span class="annot"><a href="Data.Binary.Get.Internal.html#apG"><span class="hs-pragma hs-type">apG</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Binary.Get.Internal.html#readN"><span class="hs-pragma hs-type">readN</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054795"><span class="hs-pragma hs-type">n</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054793"><span class="hs-pragma hs-type">f</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Binary.Get.Internal.html#readN"><span class="hs-pragma hs-type">readN</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054794"><span class="hs-pragma hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054792"><span class="hs-pragma hs-type">g</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#readN"><span class="hs-pragma hs-type">readN</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679054795"><span class="hs-pragma hs-type">n</span></a></span><span class="annot"><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-pragma hs-type">+</span></a></span><span class="annot"><a href="#local-6989586621679054794"><span class="hs-pragma hs-type">m</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">\</span><span id="local-6989586621679054790"><span class="annot"><a href="#local-6989586621679054790"><span class="hs-pragma hs-var">bs</span></a></span></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054793"><span class="hs-pragma hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054790"><span class="hs-pragma hs-type">bs</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%24"><span class="hs-pragma hs-type">$</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054792"><span class="hs-pragma hs-type">g</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Unsafe.html#unsafeDrop"><span class="hs-pragma hs-type">B.unsafeDrop</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054795"><span class="hs-pragma hs-type">n</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054790"><span class="hs-pragma hs-type">bs</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-406"></span><span>
</span><span id="line-407"></span><span class="hs-comment">-- | Ensure that there are at least @n@ bytes available. If not, the</span><span>
</span><span id="line-408"></span><span class="hs-comment">-- computation will escape with 'Partial'.</span><span>
</span><span id="line-409"></span><span class="annot"><a href="Data.Binary.Get.Internal.html#ensureN"><span class="hs-identifier hs-type">ensureN</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-410"></span><span id="ensureN"><span class="annot"><span class="annottext">ensureN :: Int -&gt; Get ()
</span><a href="Data.Binary.Get.Internal.html#ensureN"><span class="hs-identifier hs-var hs-var">ensureN</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679054788"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054788"><span class="hs-identifier hs-var">n0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success () r -&gt; Decoder r) -&gt; Get ()
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success () r -&gt; Decoder r) -&gt; Get ())
-&gt; (forall r. ByteString -&gt; Success () r -&gt; Decoder r) -&gt; Get ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054785"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054785"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679054784"><span class="annot"><span class="annottext">Success () r
</span><a href="#local-6989586621679054784"><span class="hs-identifier hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-411"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="../../bytestring/src/Data.ByteString.html#length"><span class="hs-identifier hs-var">B.length</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054785"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054788"><span class="hs-identifier hs-var">n0</span></a></span><span>
</span><span id="line-412"></span><span>    </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Success () r
</span><a href="#local-6989586621679054784"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054785"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-413"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Get () -&gt; forall r. ByteString -&gt; Success () r -&gt; Decoder r
forall a. Get a -&gt; forall r. ByteString -&gt; Success a r -&gt; Decoder r
</span><a href="Data.Binary.Get.Internal.html#runCont"><span class="hs-identifier hs-var hs-var">runCont</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
-&gt; Consume Int
-&gt; ([ByteString] -&gt; ByteString)
-&gt; ([ByteString] -&gt; Get ByteString)
-&gt; Get ByteString
forall s b.
s
-&gt; Consume s
-&gt; ([ByteString] -&gt; b)
-&gt; ([ByteString] -&gt; Get b)
-&gt; Get b
</span><a href="Data.Binary.Get.Internal.html#withInputChunks"><span class="hs-identifier hs-var">withInputChunks</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054788"><span class="hs-identifier hs-var">n0</span></a></span><span> </span><span class="annot"><span class="annottext">Consume Int
</span><a href="#local-6989586621679054783"><span class="hs-identifier hs-var">enoughChunks</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; ByteString
</span><a href="#local-6989586621679054782"><span class="hs-identifier hs-var">onSucc</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; Get ByteString
forall a. [ByteString] -&gt; Get a
</span><a href="#local-6989586621679054781"><span class="hs-identifier hs-var">onFail</span></a></span><span> </span><span class="annot"><span class="annottext">Get ByteString -&gt; (ByteString -&gt; Get ()) -&gt; Get ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Get ()
</span><a href="Data.Binary.Get.Internal.html#put"><span class="hs-identifier hs-var">put</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054785"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="annot"><span class="annottext">Success () r
</span><a href="#local-6989586621679054784"><span class="hs-identifier hs-var">ks</span></a></span><span>
</span><span id="line-414"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span class="hs-comment">-- might look a bit funny, but plays very well with GHC's inliner.</span><span>
</span><span id="line-415"></span><span>        </span><span class="hs-comment">-- GHC won't inline recursive functions, so we make ensureN non-recursive</span><span>
</span><span id="line-416"></span><span>    </span><span id="local-6989586621679054783"><span class="annot"><span class="annottext">enoughChunks :: Consume Int
</span><a href="#local-6989586621679054783"><span class="hs-identifier hs-var hs-var">enoughChunks</span></a></span></span><span> </span><span id="local-6989586621679054778"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054778"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679054777"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054777"><span class="hs-identifier hs-var">str</span></a></span></span><span>
</span><span id="line-417"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="../../bytestring/src/Data.ByteString.html#length"><span class="hs-identifier hs-var">B.length</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054777"><span class="hs-identifier hs-var">str</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054778"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ByteString, ByteString) -&gt; Either Int (ByteString, ByteString)
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054777"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#empty"><span class="hs-identifier hs-var">B.empty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-418"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Either Int (ByteString, ByteString)
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054778"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="../../bytestring/src/Data.ByteString.html#length"><span class="hs-identifier hs-var">B.length</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054777"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-419"></span><span>    </span><span class="hs-comment">-- Sometimes we will produce leftovers lists of the form [B.empty, nonempty]</span><span>
</span><span id="line-420"></span><span>    </span><span class="hs-comment">-- where `nonempty` is a non-empty ByteString. In this case we can avoid a copy</span><span>
</span><span id="line-421"></span><span>    </span><span class="hs-comment">-- by simply dropping the empty prefix. In principle ByteString might want</span><span>
</span><span id="line-422"></span><span>    </span><span class="hs-comment">-- to gain this optimization as well</span><span>
</span><span id="line-423"></span><span>    </span><span id="local-6989586621679054782"><span class="annot"><span class="annottext">onSucc :: [ByteString] -&gt; ByteString
</span><a href="#local-6989586621679054782"><span class="hs-identifier hs-var hs-var">onSucc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#concat"><span class="hs-identifier hs-var">B.concat</span></a></span><span> </span><span class="annot"><span class="annottext">([ByteString] -&gt; ByteString)
-&gt; ([ByteString] -&gt; [ByteString]) -&gt; [ByteString] -&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Bool) -&gt; [ByteString] -&gt; [ByteString]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#dropWhile"><span class="hs-identifier hs-var">dropWhile</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Bool
</span><a href="../../bytestring/src/Data.ByteString.html#null"><span class="hs-identifier hs-var">B.null</span></a></span><span>
</span><span id="line-424"></span><span>    </span><span id="local-6989586621679054781"><span class="annot"><span class="annottext">onFail :: [ByteString] -&gt; Get a
</span><a href="#local-6989586621679054781"><span class="hs-identifier hs-var hs-var">onFail</span></a></span></span><span> </span><span id="local-6989586621679054775"><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054775"><span class="hs-identifier hs-var">bss</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a)
-&gt; (forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Success a r
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; String -&gt; Decoder r
forall a. ByteString -&gt; String -&gt; Decoder a
</span><a href="Data.Binary.Get.Internal.html#Fail"><span class="hs-identifier hs-var">Fail</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ByteString] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#concat"><span class="hs-identifier hs-var">B.concat</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679054775"><span class="hs-identifier hs-var">bss</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;not enough bytes&quot;</span></span><span>
</span><span id="line-425"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#ensureN"><span class="hs-pragma hs-type">ensureN</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-426"></span><span>
</span><span id="line-427"></span><span id="local-6989586621679054774"><span class="annot"><a href="Data.Binary.Get.Internal.html#unsafeReadN"><span class="hs-identifier hs-type">unsafeReadN</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054774"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054774"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-428"></span><span id="unsafeReadN"><span class="annot"><span class="annottext">unsafeReadN :: forall a. Int -&gt; (ByteString -&gt; a) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#unsafeReadN"><span class="hs-identifier hs-var hs-var">unsafeReadN</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679054773"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054773"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679054772"><span class="annot"><span class="annottext">ByteString -&gt; a
</span><a href="#local-6989586621679054772"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
forall a.
(forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#C"><span class="hs-identifier hs-var">C</span></a></span><span> </span><span class="annot"><span class="annottext">((forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a)
-&gt; (forall r. ByteString -&gt; Success a r -&gt; Decoder r) -&gt; Get a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054771"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054771"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679054770"><span class="annot"><span class="annottext">Success a r
</span><a href="#local-6989586621679054770"><span class="hs-identifier hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-429"></span><span>  </span><span class="annot"><span class="annottext">Success a r
</span><a href="#local-6989586621679054770"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Unsafe.html#unsafeDrop"><span class="hs-identifier hs-var">B.unsafeDrop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054773"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054771"><span class="hs-identifier hs-var">inp</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(a -&gt; Decoder r) -&gt; a -&gt; Decoder r
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; a
</span><a href="#local-6989586621679054772"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054771"><span class="hs-identifier hs-var">inp</span></a></span><span> </span><span class="hs-comment">-- strict return</span><span>
</span><span id="line-430"></span><span>
</span><span id="line-431"></span><span class="hs-comment">-- | @readNWith n f@ where @f@ must be deterministic and not have side effects.</span><span>
</span><span id="line-432"></span><span id="local-6989586621679055211"><span class="annot"><a href="Data.Binary.Get.Internal.html#readNWith"><span class="hs-identifier hs-type">readNWith</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055211"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679055211"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055211"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-433"></span><span id="readNWith"><span class="annot"><span class="annottext">readNWith :: forall a. Int -&gt; (Ptr a -&gt; IO a) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#readNWith"><span class="hs-identifier hs-var hs-var">readNWith</span></a></span></span><span> </span><span id="local-6989586621679054769"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054769"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679054768"><span class="annot"><span class="annottext">Ptr a -&gt; IO a
</span><a href="#local-6989586621679054768"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-434"></span><span>    </span><span class="hs-comment">-- It should be safe to use accursedUnutterablePerformIO here.</span><span>
</span><span id="line-435"></span><span>    </span><span class="hs-comment">-- The action must be deterministic and not have any external side effects.</span><span>
</span><span id="line-436"></span><span>    </span><span class="hs-comment">-- It depends on the value of the ByteString so the value dependencies look OK.</span><span>
</span><span id="line-437"></span><span>    </span><span class="annot"><span class="annottext">Int -&gt; (ByteString -&gt; a) -&gt; Get a
forall a. Int -&gt; (ByteString -&gt; a) -&gt; Get a
</span><a href="Data.Binary.Get.Internal.html#readN"><span class="hs-identifier hs-var">readN</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679054769"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">((ByteString -&gt; a) -&gt; Get a) -&gt; (ByteString -&gt; a) -&gt; Get a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054767"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054767"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; a
forall a. IO a -&gt; a
</span><a href="../../bytestring/src/Data.ByteString.Internal.html#accursedUnutterablePerformIO"><span class="hs-identifier hs-var">accursedUnutterablePerformIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO a -&gt; a) -&gt; IO a -&gt; a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; (CString -&gt; IO a) -&gt; IO a
forall a. ByteString -&gt; (CString -&gt; IO a) -&gt; IO a
</span><a href="../../bytestring/src/Data.ByteString.Unsafe.html#unsafeUseAsCString"><span class="hs-identifier hs-var">B.unsafeUseAsCString</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679054767"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr a -&gt; IO a
</span><a href="#local-6989586621679054768"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(Ptr a -&gt; IO a) -&gt; (CString -&gt; Ptr a) -&gt; CString -&gt; IO a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">CString -&gt; Ptr a
forall a b. Ptr a -&gt; Ptr b
</span><a href="../../base/src/GHC.Ptr.html#castPtr"><span class="hs-identifier hs-var">castPtr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-438"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#readNWith"><span class="hs-pragma hs-type">readNWith</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-439"></span></pre></body></html>